Tag: android-gradle

Android gradle uploadArchives when building

I have my uploadArhives to Maven repository .aar publishing. But I have to run gradlew uploadArhives from the console all the time, how to code to make it invoke with every build or with release build? uploadArchives { repositories { mavenDeployer { def credentials = [ userName: NEXUS_USERNAME, password: NEXUS_PASSWORD ] repository(url: MAVEN_REPO_URL, authentication: credentials) […]

How can I view the CLI command executed by a Gradle task in Android Studio?

I’m trying to get a better picture of what happens behind the scenes in Android Studio when building an Android application. I’ve been reading up on Gradle, but one thing I cannot figure out is how to see the respective CLI command and arguments that is being invoked by Gradle. It seems to be abstracted […]

Android NDK - multlib support using gradle

My question is directed towards native Android development for 64bit Android systems. I am looking for a way to configure the support of 32bit compiled native libraries at a 64bit Android system using the gradle build system. The libraries the application should use are only available as 32bit build. It would be very time consuming […]

Android Library project com.android.dex.DexException: Multiple dex files define Lcom/google/gson/JsonSerializer

I am writing a library project in Android Studio. My gradle file includes gson volley play-services etc… When embedding my library in a project I get: com.android.dex.DexException: Multiple dex files define Lcom/google/gson/JsonSerializer; Could someone explain how gradle works when creating library projects? What should I explain the developer who integrates my SDK, how does exclude […]

Proguard slowing down android build process too much

My Android app build process takes 3+ minutes with ProGuard enabled. What are some basic things I can do to speed this up?

Android AssertJ 1.0.0 with Android gradle 1.1.1

Here is part of my build.gradle that has conflict: … dependencies { classpath ‘com.android.tools.build:gradle:1.1.1’ } … testCompile( ‘com.squareup.assertj:assertj-android:1.0.0’ ) … The issue that I see in log: WARNING: Conflict with dependency ‘com.android.support:support-annotations’. Resolved versions for app (21.0.3) and test app (20.0.0) differ. Apparently it removes conflicting dependency from the classpath. I’m not sure if it […]

Gradle: how do I include a local jar from a dependent java project in an Android build?

In my Android app, I’m getting a java.lang.NoClassDefFoundError when the code that references code in a dependent .jar is executed. My project includes an Android module as well as a java-only library module, which is where the jar dependency is. I’m using gradle 1.10 to build the project. Here is my project layout: myProject – […]

Android Studio Gradle issue after updating to version 0.6.0

Since I updated Android Studio to version 0.6.0 I’m facing following issue with Gradle Sync: There’s a discussion on Google+ and Google adt-dev group which suggests that the auto enabling of new Manifest Merger causing the issue. The discussion and solution is so unclear on both platforms, although I did try to add android { […]

Applying the plugin 'kotlin-android' in an Instant App results in “null cannot be cast to non-null type com.android.build.gradleBasePlugin”

I’ve been trying to combine the newly publicly released Android Instant Apps with the Kotlin programming language. After creating my project using the following (standard?) setup, I get an Error with the message “null cannot be cast to non-null type com.android.build.gradle.BasePlugin” when I try to build the application. Using Kotlin works fine with standard ‘com.android.application’ […]

Different library/imports depending on build type

In an Android app, I need to use a specific SDK for a certain peripheral. Everything works fine with a single build variant: provided fileTree(include: [‘peripheral.jar’], dir: ‘libs’) compile fileTree(exclude: [‘peripheral.jar’], dir: ‘libs’) The problem is that the SDK relies on a shared library installed in the actual peripheral. If I try to install the […]

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