Tag: gradle

How can I import a new module (android library project) using Android studio 0.3.0

The android tools team made a huge step when introducing android studio 0.3.0 with the new user interface for modifying the build.grade file using the project structure. But how can I import an android library project into my general project? When I press the ‘+’ button in the Project structore -> Modules section I can […]

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 […]

Removing AndroidManifest element with gradle product flavors

I’m setting up an Android gradle project with a few product flavors. I would like to have the <uses-permission android:name=”android.permission.INTERNET” /> permission in all but one of my flavors. I know it is possible to have a particular flavor add a permission, but is it possible to have a flavor remove one? The only other […]

FindBugs Android Gradle No classes configured error

I am trying to use the FindBugs plugin for Gradle with an Android build. The build.gradle file buildscript { repositories { mavenCentral() } dependencies { classpath ‘com.android.tools.build:gradle:0.6.+’ } } apply plugin: ‘android’ apply plugin: ‘findbugs’ android { compileSdkVersion 19 buildToolsVersion “19.0.0” defaultConfig { minSdkVersion 8 targetSdkVersion 19 } } dependencies { compile ‘com.android.support:appcompat-v7:+’ } But […]

Android Studio – Gradle

I’m trying to use the newest version of gradle for android studio which is 1.3.0. http://android-developers.blogspot.ro/2015/07/get-your-hands-on-android-studio-13.html Unfortunately I have problems while trying to update the gradle version. Previous version of gradle was 1.2.3 and now wanted to update this to 1.3.0. I’m getting the following error: Error:Cannot access first() element from an empty List I […]

Android Studio Keep saying Failed to complete Gradle execution

Everything fine with the command line gradle build But Android Studio keep saying that Failed to complete Gradle execution Cause: A fatal exeption has occurred. Program will exit If I clear all the cache, and restart everything will be fine, but this dialog will easily comeback again (after a build fail). I guess that the […]

How to avoid DEX 64K LIMIT by importing the right library

I had this issue where I overflow the 64k method limit in Dalvik when compiling all the library I used. I started to have this issue when I imported the Support Library, as some are already contained in others, it ended up overflowing the limit. Is there a way to verify if a library is […]

Specifying Maven dependencies in build.gradle doesn't work

I tried to add a Maven dependency to my project, which uses Gradle, by adding these lines to the build.gradle file in Android Studio: repositories { mavenCentral() } dependencies { compile files(‘libs/android-support-v4.jar’) compile ‘org.roboguice:roboguice:2.0′ } The project seems to compile well, but there’s no way to reference Roboguice classes inside my project’s code. I feel […]

How do I add a version number to my APK files using 0.14+ versions of the Android Gradle plugin?

I want to have the versionName included in the name of the output APK files from my Android build. There’s an another answer that works with pre-0.14.x plugin versions, but they changed some of the data model so that doesn’t work anymore, and I couldn’t figure out how to fix it. As far as I […]

How to add meta-data to gradle/AndroidStudio generated manifest

I’m migrating from an Ant/Eclipse environment to Gradle/Android Studio, and some tools we use need the Android app to have meta-data tags present with both android:name and android:value fields set. We currently have two build-variants of the app, specified as productFlavours/buildTypes in the build.gradle file. As the Android manifest.xml files are generated by gradle at […]

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