Tag: gradle

“Package R does not exist” error when building with Gradle from command line

I’m attemping to build an Android project with Gradle from command line, but found a problem when I want to change the directory structure. Currently is like this: . └── main ├── AndroidManifest.xml ├── ic_launcher-web.png ├── java │ └── com │ └── myproject │ └── MainActivity.java └── res ├── … ├── layout │ ├── activity_main.xml […]

Android studio gradle error with top-level exception

I have recently updated my Android Studio, since then my project does not build…I get errors like the error below: Error Code: 1 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dx.cf.iface.ParseException: class name (org/pervasivesystems/mobilehealth/activities/AppSettingsActivity$AppSettingsFragment) does not match path (org/pervasivesystems/mobilehealth/Activities/AppSettingsActivity$AppSettingsFragment.class) I have many of these errors…I guess it has something to do with the capital letters? I wanted to […]

Referencing the user's home directory in a Gradle script

Is there a cleaner way to reference a file in the user’s home directory than doing the following in a gradle script? (referencing an Android keystore in this example) homeDir = System.getenv(‘HOMEDRIVE’) + System.getenv(‘HOMEPATH’); … signingConfigs { release { storeFile file(homeDir + “\\.android\\releaseKeystore.jks”) } } …

Error:Could not find property 'assembleDebug' on project ':app'

I am using ‘com.android.tools.build:gradle:2.2.0-alpha6’ and Android Studio 2.2 Preview 6. The build runs perfectly fine on Gradle 2.1.0, but to enable instant run it asks me to update Gradle plugin. On updating Gradle plugin, the build shows “Error:Could not find property ‘assembleDebug’ on project ‘:app'”. I already tried cleaning .gradle and .idea and reloading the […]

Define buildconfigfield for an specific flavor AND buildType

I have 2 flavors, lets say Vanilla and Chocolate. I also have Debug and Release build types, and I need Vanilla Release to have a field true, while the other 3 combinations should be false. def BOOLEAN = “boolean” def VARIABLE = “VARIABLE” def TRUE = “true” def FALSE = “false” VANILLA { debug { […]

Gradle dependencies resolving suddenly extremely slow

I am developing Android project with Android Studio and gradle. Till yesterday, gradle build was building relatively fast in a few seconds. Since today, it suddenly became 5 minutes per build. I gave bigger size on gradle VM but still has no hope. Could anyone give me any tips what is going on and how […]

New Jack toolchain crashes when using android-apt plugin

I’m trying to build a simple project with the new Jack toolchain. My project relies on android-apt plugin (it uses some annotation processing tool, but build error occures, even before I tried to add this tool). Here is my module build script (I’m using Android Studio 1.3 and gradle plugin 1.3.0): apply plugin: ‘com.android.application’ buildscript […]

How to import Action Bar Sherlock to gradle project?

I’ve imported Module to Android Studio using steps posted this question: Problems importing project into Android Studio regarding ActionBarSherlock The IDE is working well, but It doesn’t affect the build. From Android Studio: Are Library Project dependencies picked from project.properties? If you use Gradle, project.properties is completely ignored. You should not use the Module Settings […]

Gradle couldn't find com.android.databinding:dataBinder:1.0-rc0

As I am going over Android Data binding Guide from https://developer.android.com/tools/data-binding/guide.html. I have made sure I am running Android Studio 1.3 (canary version). Following the guidelines, I get this error: Gradle sync failed: could not find com.android.databinding:library:1.0-rc0 Has anyone else have the same problem? Thanks for your help. App build.gradle buildscript { repositories { jcenter() […]

How to determine the version of Gradle?

How can I know which version of Gradle I am using in my Android Studio? Please guide. I want to make sure I am using Gradle version 2.2.1.

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