Tag: android-gradle

Can an Android library JAR depend on an Android library AAR?

I have an Android library project FooLib. FooLib references things like Android Contexts but doesn’t require any resource files (things in res/) so I am currently packaging this as a JAR for my app to consume. I now want to make FooLib depend on BarLib, but BarLib does use resources so I can’t package BarLib […]

How to copy debug assets for unit tests

I have an android library gradle project. And I need to copy some files to assets folder for robolectric unit tests. To do it I’ve defined a copy task: task copyDebugAssets(type: Copy) { from “${projectDir}/somewhere” into “${buildDir}/intermediates/bundles/debug/assets” } but I can’t add this task as a dependency for processDebugResources task: processDebugResources.dependsOn copyDebugAssets because of this […]

How Do We Point androidTest to a Peer Eclipse-Style Project?

I am helping out the Guardian Project on NetCipher. For legacy reasons, they want to keep their existing project structure, which was based on Eclipse. However, rather than having the tests in a tests/ subdirectory of the library, they went with a peer project model. So, off of the repo root, libnetcipher/ is the library […]

data binding – safeUnbox warning

after i upgrade AS gradle version to 2.3.0, data binding encounter a warning : Warning:selectMap[index] is a boxed field but needs to be un-boxed to execute selectMap[index] ? @android:color/white : @android:color/transparent. This may cause NPE so Data Binding will safely unbox it. You can change the expression and explicitly wrap selectMap[index] with safeUnbox() to prevent […]

how to downgrade proguard version in android studio gradle?

I am trying to build an android app using scala and android studio. The compile fails at proguard with an exception: Error:java.lang.ArrayIndexOutOfBoundsException: 4 at proguard.classfile.editor.InterfaceDeleter.visitSignatureAttribute(InterfaceDeleter.java:162) at proguard.classfile.attribute.SignatureAttribute.accept(SignatureAttribute.java:97) I found at another place (http://sourceforge.net/p/proguard/bugs/549/) that this issue is caused by a bug in scala, but that it only occurs in proguard 5.1 and not in proguard […]

How to edit the code of a library imported with Gradle in Android Studio?

I’m facing a little problem with one of my libraries in Android Studio. This one is imported with a Gradle file, like this : dependencies { compile ‘com.github.navasmdc:MaterialDesign:1.5@aar’ } It has a known issue from its GitHub repository but I can only fix it by editing one line of code in a file of this […]

Error:Execution failed for task , finished with non-zero exit value 1

Error:Execution failed for task ‘:onyxenrollwizardsampleapp:processDebugResources’. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Android\sdk\build-tools\23.0.2\aapt.exe” finished with non-zero exit value 1 Here is my Gradle file. Kindly help me out apply plugin: ‘com.android.application’ android { compileSdkVersion 23 buildToolsVersion “23.0.2” defaultConfig { applicationId “com.example.onyx_enroll_wizard_sample_app” minSdkVersion 14 targetSdkVersion 23 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.txt’ } } lintOptions […]

Running AspectJ causes NoSuchMethodError: Aspect.aspectOf

I have a very simple AspectJ aspect (using @AspectJ) which just prints out a log message. My goal is to advice code in my android application. Now this aspects works perfectly fine as long as I have the aspect class itself in my applications source-code. Once I move the aspect into a different module (either […]

Is it mandatory to use Gradle with Android Studio?

I’m using android studio since its official release. Till now which I use Android Studio version 2.1.2, I need to wait for hours to import a project for first time and let gradle synchronize. Some people recommend to run android studio in offline mode but when I want to use external libraries I need to […]

Resource entry com.crashlytics.android.build_id is already defined

My project was working and everything was fine but have no idea what happened suddenly that I’m getting error when I want to build my project. This is Gradle output: /Users/admin/Desktop/android/MY-Project/build/intermediates/res/project/debug/values/values.xml:265: error: Resource entry com.crashlytics.android.build_id is already defined. /Users/admin/Desktop/android/MY-Project/build/intermediates/res/project/debug/values/com_crashlytics_build_id.xml:9: Originally defined here. Since both of these files are auto generated I cannot do anything 🙁 […]

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