Tag: android-gradle

Google Play API returning error 401

I’m using gradle-play-publisher library to upload my app to Google Play, but I get error 401 Unauthorized when executing the publishing task. My dev account at Google Play and service account at Dev Console are set up. Play API is enabled. As I see from build logs, the first request sent is: POST https://accounts.google.com/o/oauth2/token I […]

Use Android DataBinding plugin parallel to GoogleServices plugin

was anyone able to use Android DataBinding plugin parallel to GoogleServices pluginplugin? dependencies { classpath ‘com.android.tools.build:gradle:1.3.1’ classpath ‘com.google.gms:google-services:1.4.0-beta3’ classpath ‘com.android.databinding:dataBinder:1.0-rc1’ } apply plugin: ‘com.google.gms.google-services’ apply plugin: ‘com.android.databinding’ And then the whole project just exploded. When I remove services plugin then databinding works. This is gradle’s stacktrace. [data binding plugin]: failed to setup data binding java.lang.NoSuchMethodError: […]

Gradle looking for aar in wrong project's lib folder

I have an Android application made up of multiple projects. One of those projects is an App project that just extends the Application object. Inside the build.gradle for that app project, I add other projects as dependencies. I’ve just created a new module to house an SDK (aar) I want to use. I’ve also added […]

Android product flavors versionNameSuffix

I’m using buildTypes and productFlavors. My app also uses an analytics tool and this tool used the versionName of my app. How can I change the versionName per flavor? My test was productFlavors { google { versionNameSuffix “.google” } } but it failed. Does anybody has an idea how to custom the versionName depending on […]

Android Studio 1.1.0 Gradle project sync failed Error importing a Gradle project on a OSX

I just installed gradle in this folder: /Users/joanet/Development/gradle-2.3 edit the file launchd.conf sudo vim /etc/launchd.conf to set the variable GRAILS_HOME setenv GRAILS_HOME /Users/joanet/Development/gradle-2.3 then I’ve imported the project https://github.com/NordicSemiconductor/Android-nRF-Toolbox using File -> Import project but I got this error: Gradle project sync failed and Error: Configuration with name ‘default’ not found in Android Studio I […]

Android Studio ignore –core-library flag

I have a project, which i want to configure on my computer. On anothe computer it works, but with old version of Android Studio 0.4.0 whenever I use 0.5.2 The proble is that after I launch app it show error Build script error, unsupported Gradle DSL method found: ‘coreLibrary()’! Possible causes could be: – you […]

How to set severityOverrides in lintOptions?

I have an Android project defining buildscript { repositories { jcenter() } dependencies { // Android plugin for gradle // http://google.github.io/android-gradle-dsl classpath ‘com.android.tools.build:gradle:1.5.0’ // … In my app I want to set android { // … lintOptions { // http://google.github.io/android-gradle-dsl/1.5/com.android.build.gradle.internal.dsl.LintOptions.html#com.android.build.gradle.internal.dsl.LintOptions:severityOverrides severityOverrides { [“MissingTranslation”: “warning”] } // … but I get the error Error:(34, 0) Gradle […]

Cannot filter assets for multiple densities using SDK build tools 21 or later

Due to an issue building my application in release mode with the gradle plugin 1.3.0, I have switched to 1.4.0 (beta 2), which fixes said build issue. However, whereas some flavors build perfectly, others have their build aborted with the following error message: Cannot filter assets for multiple densities using SDK build tools 21 or […]

Code Path per Flavor in Android Gradle

I have 2 buildTypes (debug, release) and 2 productFlavors (product1, product2). I want to define a buildConfigField for each buildType and productFlavors. The buildConfigField is the url the app to download data from the server, and it changes for each productFlavor and buildTypes. Now, I have: buildTypes { debug { debuggable true } release { […]

buildConfigField depending on flavor + buildType

I’m trying to define a buildConfigVariable depending on the flavor + buildType. Ideally, this is what I want productFlavors { strawberry { buildConfigField “String”, “WS_API_KEY”, name + variant.buildType.name } … more flavors .. } name does contain “strawberry”, but I don’t know if it’s possible to access the variant‘s buildType. Placed outside the Android closure […]

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