Tag: gradle

Gradle hangs on Executing tasks: [:android:generateDebugSources

Since updating my Mac OS X to El Capitan (and android studio from 1.5.1 to 2.x with all tools and sdks) I have problems with my libgdx–robovm game in Android Studio. When I’m doing Gradle Sync it always hangs on: Executing tasks: [:android:generateDebugSources, :android:generateDebugAndroidTestSources, :android:mockableAndroidJar, :android:prepareDebugUnitTestDependencies, :android-full:generateDebugSources, :android-full:generateDebugAndroidTestSources, :android-full:mockableAndroidJar, :android-full:prepareDebugUnitTestDependencies] Always. By hanging I mean […]

How to use multiple res.srcDirs and override some resources with gradle

I want to build different versions of my app based on different productFlavors, but need some degree of flexibility that I can’t achieve yet. This is my folder structure: +src +main +java +res +base +java +res +custom1 +java +res +custom2 +res The common code is on main (a service) and the base ui is on […]

How can I add a generated Source Folder to my Source Path in Gradle?

I use annotation processing. Therefore I use the apt plugin. It generates new java sources in build/source/apt. Here is my build.gradle: apply plugin: ‘java’ apply plugin: ‘eclipse’ apply plugin: ‘apt’ apply plugin: ‘war’ apply plugin: ‘gwt’ apply plugin: ‘jetty’ sourceCompatibility = 1.7 version = ‘1.0’ eclipse { classpath { downloadSources=true downloadJavadoc=true } } buildscript { […]

Mixing android plugins from gradle and gradle-experimental

Is there any way or workarounds or just hints to make plugins from gradle and gradle-experimental working together? For example to mix those two versions: com.android.tools.build:gradle:1.3.1 com.android.tools.build:gradle-experimental:0.3.0-alpha4 I have an existing project which uses some external plugins (app/build.gradle): apply plugin: ‘com.android.model.application’ apply plugin: ‘com.android.databinding’ apply plugin: ‘com.jakewharton.hugo’ in my root build.gradle I have: com.android.tools.build:gradle-experimental:0.3.0-alpha4 Issues […]

Gradle Configurations not Working as Expected in New Android Build System

Environment Configuration com.android.tools.build:gradle:0.4 gradle version 1.6 jdk 1.6 (OSX) android build tools version 17 compile sdk version 17 The issue that I seem to be having is that I can’t seem to exclude lombok from being added to the apk. I tried to do it by creating a provided configuration like this: configurations { provided […]

java.lang.UnsatisfiedLinkError – NDK in android studio gradle?

Folder structure app —main —java —-jni —–Android.mk —–Application.mk —– hello-jni.c —res in build.gradle apply plugin: ‘com.android.application’ android { compileSdkVersion 21 buildToolsVersion “22.0.1” defaultConfig { applicationId “com.example.hellojni” minSdkVersion 17 targetSdkVersion 21 sourceSets.main { jni.srcDirs = [] jniLibs.srcDir ‘src/main/libs’ } ndk { moduleName “hello-jni” cFlags “-std=c++11 -fexceptions” ldLibs “log” stl “gnustl_shared” abiFilter “armeabi-v7a” } task nativeLibsToJar(type: Zip, […]

Create an AAR that depends on multiple AARs

I am working to build an SDK that can be used in other application. My project structure is as follows: ProjectFolder | +–AndroidLibs | | | +–UI (android library – AAR) | | | +–Protocol (android library – AAR) | | | +–infra (android library – AAR) | +–SDK(depends on UI, Protocol and Infra) | […]

Android Studio – Build variants not showing up

I recently updated Android Studio to version 0.3.0 and now there are no build variants I can choose from. I have tried cleaning and rebuilding the project, and restarting Android Studio with no success. My build.gradle is android { compileSdkVersion 18 buildToolsVersion “18.0.1” defaultConfig { minSdkVersion 9 targetSdkVersion 18 versionCode 10 } productFlavors { lite […]

Migrating project to new experimental gradle plugin

I try to migrate my Android project to new experimental gradle plugin. I followed instructions at this page. I made changes in required files, but I have an error when I trying to Sync project with gradle files. Error:Unable to load class ‘com.android.build.gradle.managed.ProductFlavor_Impl’. Possible causes for this unexpected error include: Gradle’s dependency cache may be […]

connectedAndroidTest and release build type

I’m using gradle:1.2.3 I would like to run my androidConntectTests (instrumentation tests) on release (signed, minified) configuration, but I cannot. My build types: buildTypes { debug { minifyEnabled false debuggable true } robotium { debuggable true minifyEnabled true signingConfig signingConfigs.release proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’ } release { minifyEnabled true debuggable false signingConfig signingConfigs.release proguardFiles getDefaultProguardFile(‘proguard-android.txt’), ‘proguard-rules.pro’ […]

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