Tag: gradle

Android studio + Gradle + Android Annotations

I am trying to add AndroidAnnotations to Android Studio project that has a gradle build system. Has anyone done this? Can anyone help me with this? I do not even know where to start. I know how to add libraries to gradle but AndroidAnnotations requires 2 jar files and I do not know what should […]

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

multiproject gradle build error: package does not exist

I have some problems with building multiproject with gradle. I read all similar questions but nothing help. The structure of my projects looks like: App/ settings.gradle app/ build.gradle libraries/ Core(git submodule)/ Core/ build.gradle libraries/ ZBarLibrary/ build.gradle settings.gradle App/settings.gradle include ‘:App’, ‘:libraries:Core’, ‘:libraries:ZBarLibrary’ project(‘:libraries:Core’).projectDir = new File(settingsDir, ‘libraries/Core/Core’) project(‘:libraries:ZBarLibrary’).projectDir = new File(settingsDir, ‘libraries/Core/libraries/ZBarLibrary’) App/app/build.gradle buildscript { […]

Error:Failed to resolve: annotationProcessor

This is the following error I am getting while adding a new gradle dependency to my android project. And this error is not project specific. I am getting the same error if I am adding the plugin in any other android project Error while adding any third party plugin I also posted my project app […]

Multiple maven repositories in Gradle

I have the following build.gradle: buildscript { repositories { maven { url ‘https://maven.fabric.io/public’ } maven { url “https://dl.bintray.com/fyber/maven” } maven { url “https://dl.bintray.com/supersonic/android-sdk” } } dependencies { classpath ‘io.fabric.tools:gradle:1.19.1’ } } apply plugin: ‘com.android.application’ apply plugin: ‘io.fabric’ apply plugin: ‘com.google.gms.google-services’ dependencies { // Ads compile ‘com.supersonic.sdk:mediationsdk:6.1.0@jar’ } And I’m getting this error: Error:(88, 13) Failed […]

Gradle – How to get values from AndroidManifest?

Inside build.gradle for Android project task runAndroidApplication(type: Exec, dependsOn: ‘:installDebug’) { //TODO update Activity name below or find a way to get it from AndroidManifest.xml if (System.properties[‘os.name’].toLowerCase().contains(‘windows’)) { // windows commandLine ‘cmd’, ‘/c’, ‘adb’, ‘shell’, ‘am’, ‘start’, ‘-n’, “com.example.androidapptorun.MainActivity” } else { // linux commandLine ‘adb’, ‘shell’, ‘am’, ‘start’, ‘-n’, “com.example.androidapptorun.MainActivity” } } How to […]

Don't fail the gradle build if a test is failing with the gradle-android-test-plugin

I set my project up to run with Robolectric and the the gradle-android-test-plugin. This all works fine and first tests are running and failing. If a test fails this will also fail the gradle build. Is there a way to just let the build go on and write down the failing tests for evaluation in […]

How to Setup gradle-2.2.1-all.zip Manually

I want to run my unit test with this command gradlew.bat connectedInstrumentTest But it tries to download https://services.gradle.org/distributions/gradle-2.2.1-all.zip And my corporal network blocks it. Hence, I want to setup the zip manually, I already downloaded it from browser. The ways I failed are listed below Pasting it in Program Files\Android\Android Studio\gradle\ gradle-2.2.1 didn’t work File […]

Android: Using SVG in res leads to error: “The file name must end with .xml or .png”

I just updated Android Studio 1.2.1.1 and now gradle got problems with svg in my resources folder. I was always using SVGs with no problem and I hope they will be “allowed” in the future. :app:mergeDebugResources :app:mergeDebugResources FAILED /home/petergriffin/folder1/another-app/MyAwesome-App/app/src/main/res/drawable-hdpi/logo.svg Error:Error: The file name must end with .xml or .png Error:Execution failed for task ‘:app:mergeDebugResources’. > […]

SDK location not found. ANDROID_HOME – building a gradle project in eclipse on a MAC

I’m in the process of running through a tutorial on getting Libgdx working with eclipse on my MAC. I am currently building one of the example projects using gradle in eclipse so I can run through the tutorials and learn a bit more. When I import and build the example code project (I’m using a […]

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