Tag: android-gradle

How do I configure android tests directory?

The Android gradle build forces my AndroidTests to be in src/androidTests. How do I change this to be another directory of my choosing? Here is some background: I am migrating a project from eclipse. According to the build documentation, when I add this to my gradle build file: androidTest.setRoot(‘tests’) The android gradle build does this: […]

java.lang.IllegalAccessError: Method 'void android.support.v4.content

I updated playservice in my sdk and I got this error. And I am not able to access GCM Token. Before update sdk my project work perfectly. I waste my whole day in it but not found any solution. I tried this but gettting error in this dependencies com.google.android.gms:play-services-plus:9.0.0 Here is my logcat Caused by: […]

Android build tools 1.1.0, unit test folder?

I recently installed the latest tools from google to my android project: buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath ‘com.android.tools.build:gradle:1.1.0’ } } allprojects { repositories { jcenter() } } apply plugin: ‘com.android.application’ android { compileSdkVersion 21 buildToolsVersion “21.1.2” compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { applicationId “com.xxx” minSdkVersion 10 targetSdkVersion […]

Gradle sync failed after switching to 3.0 canary 5

After switching to Android Studio 3.0 canary 5 I can’t build my gradle after some searching i found out that the error is caused due to outdated Guava library but i am not using Guava in my project. Project Gradle buildscript { ext.kotlin_version = ‘1.1.3’ repositories { jcenter() maven { url ‘https://maven.fabric.io/public’ } } dependencies […]

Why does the BuildConfig class use Boolean.parseBoolean() instead of literal values?

When looking at the BuildConfig class generated by Android Studio and the Gradle plugin one can see that the BuildConfig.DEBUG field is initialized using the Boolean.parseBoolean(String) call instead of using one of the boolean literals true or false. When I add custom build properties using Gradle I would simply do it like this: android { […]

What is the Android plugin version included in IntelliJ IDEA?

… and how to find it out (in an authorative way)? In Android Studio 0.8.11: when I check the same it shows which corresponds to http://tools.android.com/recent and http://developer.android.com/sdk/installing/studio.html. In IDEA EAP 14: when I go to Settings > Plugins > Android Support the version number shown is 10.0 which doesn’t correspond to a recent […]

Calling Gradle buildConfig multiple times

I’m trouble figuring out a way to add multiple lines to my BuildConfig using Gradle. It appears that when I call buildConfig a 2nd time, the first one disappears. I was originally adding this buildConfig from a different spot, but was able to create a minimal reproducible test if I do this: buildTypes { debug […]

Exclude .jar from compile in Android Studio with Gradle

I currently have something like this in the build.gradle file. dependencies { compile ‘com.android.support:support-v4:13.0.+’ compile (‘com.xxx:xxx-commons:1.+’) { } } A problem arises since both jUnit and hamcrest-core are present in the com.xxx:xxx maven repository, creating an error like this: Gradle: Origin 1: /Users/yyy/.gradle/caches/artifacts-26/filestore/junit/junit/4.11/jar/4e031bb61df09069aeb2bffb4019e7a5034a4ee0/junit-4.11.jar Gradle: Origin 2: /Users/yyy/.gradle/caches/artifacts-26/filestore/org.hamcrest/hamcrest-core/1.3/jar/42a25dc3219429f0e5d060061f71acb49bf010a0/hamcrest-core-1.3.jar Gradle: Execution failed for task ‘:android:packageDebug’. > Duplicate […]

Error:Execution failed for task ':app:processDebugResources'. > at index 4

I having problem while building my project after revision 2 update of the latest SDK(Sorry,I dont remeber the version number).I run the code succesfully before. I dont think there is any error in my project.I often get error message as “IDE internal error occured” is that anything to do with this. please help thanks.Required codes […]

Error JSON.simple: java.util.zip.ZipException: duplicate entry: org/hamcrest/BaseDescription.class

I am facing a problem in android studio after adding JSON.simple and enabling MultiDex and get the following error: Error:Execution failed for task ‘:app:packageAllDebugClassesForMultiDex’. java.util.zip.ZipException: duplicate entry: org/hamcrest/BaseDescription.class Here is my build.gradle : apply plugin: ‘com.android.application’ android { compileSdkVersion 23 buildToolsVersion “23.0.1” defaultConfig { applicationId “com.MildlyGoodApps.EffortlessDescriptions” minSdkVersion 10 targetSdkVersion 23 versionCode 1 versionName “1.0” multiDexEnabled […]

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