Tag: android-gradle

Gradle – How to get values from AndroidManifest?

Inside build.gradle for Android project task runAndroidApplication(type: Exec, dependsOn: ‘:installDebug’) { //TODO update Activity name below or find a way to get it from AndroidManifest.xml if (System.properties[‘os.name’].toLowerCase().contains(‘windows’)) { // windows commandLine ‘cmd’, ‘/c’, ‘adb’, ‘shell’, ‘am’, ‘start’, ‘-n’, “com.example.androidapptorun.MainActivity” } else { // linux commandLine ‘adb’, ‘shell’, ‘am’, ‘start’, ‘-n’, “com.example.androidapptorun.MainActivity” } } How to […]

Android: Execution failed for task ':app:processDebugResources'

Error:Execution failed for task ‘:app:processDebugResources’. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/home/mobi27/opt/AND-Studio/Android/Sdk/build-tools/22.0.1/aapt” finished with non-zero exit value 1

Android: Using SVG in res leads to error: “The file name must end with .xml or .png”

I just updated Android Studio and now gradle got problems with svg in my resources folder. I was always using SVGs with no problem and I hope they will be “allowed” in the future. :app:mergeDebugResources :app:mergeDebugResources FAILED /home/petergriffin/folder1/another-app/MyAwesome-App/app/src/main/res/drawable-hdpi/logo.svg Error:Error: The file name must end with .xml or .png Error:Execution failed for task ‘:app:mergeDebugResources’. > […]

google GCM android crashes ( java.lang.NoClassDefFoundError: com.google.android.gms.R$string )

I am developing an app using the Google GCM service and it seems to be crashing on all pre-lollipop devices at Launch.. I Have followed google tutorial… and its working on lollipop and marshmallow here are my project level dependencies dependencies { classpath ‘com.android.tools.build:gradle:1.5.0’ classpath ‘com.google.gms:google-services:1.5.0’ } I have this in my app level gradle […]

Gradle build failed to resolve aar library dependency (trnql sdk)

When I attempt to build my project using gradle, I get the following error: Failed to resolve: com.trnql:lib-release 1.0.0 It seems it cannot find the android archive file (aar) that is in the libs folder. The dependencies section of the build.gradle file looks like this: And the project structure looks like this: The aar file […]

Android Gradle – load signing config from external file

In Gradle for Android it seems to be commons practice to define your signing config for release build like this: android { signingConfigs { debug { storeFile file(“debug.keystore”) } myConfig { storeFile file(“other.keystore”) storePassword “android” keyAlias “androiddebugkey” keyPassword “android” } } buildTypes { foo { debuggable true jniDebugBuild true signingConfig signingConfigs.myConfig } } } Thing […]

Findbugs android gradle plugin

I have an android project. I want to introduce findbugs in my project as a gradle plugin. I tried to edit the project’s build.gradle as below. buildscript { repositories { mavenCentral() maven { url ‘https://maven.fabric.io/public’ } } dependencies { classpath ‘com.android.tools.build:gradle:1.0.0+’ classpath ‘io.fabric.tools:gradle:1.+’ } } apply plugin: “java” apply plugin: “findbugs” findbugs { toolVersion = […]

Failed to resolve: com.google.android.gms:play-services-cast:9.8.00

I’m using Android Studio and have cloned the CastVideo v2 reference app and set it up with the CastCompanionLibrary as per its instructions. However, when I try to sync the gradle project, it says: Failed to resolve: com.google.android.gms:play-services-cast:9.8.00. I have the option to Install Repository and sync project but it does nothing. I have tried […]

Build Failure on Android Studio

After updating all the Google support libraries to the latest versions, from v21 to v22.2.0 and Play Services to v7.5, my project no longer builds successfully. The log i get is as follows: app:preDexDebug AGPBI: {“kind”:”simple”,”text”:”Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar “,”sources”:[{}]} AGPBI: {“kind”:”simple”,”text”:”Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar “,”sources”:[{}]} AGPBI: {“kind”:”simple”,”text”:”Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar “,”sources”:[{}]} AGPBI: {“kind”:”simple”,”text”:”Picked up […]

Failed to find target with hash string 'android-24'

I am getting this error after changing all the Google libraries to 24.0.0 and changing the compileSdkVersion and targetSdkVersion to 24. As you can see in the attached images I installed all Android N packages, but there only stands: “Partially installed”. How can I fix this?

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.