Questions tagged [android-gradle-plugin]

The Android Gradle Plugin is Android's standard build system. It is used as backing-build-system by Android Studio.

This tag is for questions about the Android Gradle plugin. The Android Gradle plugin was introduced at Google IO in 2013 and replace the legacy ant-based build system.

Resources

12908 questions
171
votes
6 answers

What Product Flavor does Android Studio build by default in build.gradle?

We have an Android project that uses the new Gradle build system, and we use Android Studio as a development tool. When there are several product flavors specified in build.gradle, we notice that Android Studio builds the first one specified…
Joe
  • 4,585
  • 3
  • 37
  • 51
168
votes
42 answers

finished with non zero exit value

I am trying to import my project. but when I run the application I am getting the following error: Error: Execution failed for task ':app:processDebugResources'. > com.android.ide.common.process.ProcessException: …
Ankur1994a
  • 2,112
  • 2
  • 13
  • 18
167
votes
20 answers

android studio 0.4.2: Gradle project sync failed error

After updating to 0.4.2 I get this error when opening a project: 'Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work proprerly' The event log shows this: Error occurred during initialization of VM Could not…
166
votes
9 answers

How do I show dependencies tree in Android Studio?

My goal is to see the tree of dependencies (such as: appcompat, dagger, etc) in a particular project. Like the one IntelliJ:
fruqi
  • 4,983
  • 4
  • 26
  • 32
166
votes
6 answers

Is it possible to declare git repository as dependency in android gradle?

I want to use master version of my lib from mavencentral. Is it possible to declare git repository as dependency in android gradle?
Alexey Zakharov
  • 24,694
  • 42
  • 126
  • 197
159
votes
17 answers

Missing api_key/current key with Google Services 3.0.0

Since I upgraded the project with the latest version of google services and libraries (9.0.0), I have this strange issue : Grade console : :app:processDebugGoogleServices Parsing json file:…
palmsnipe
  • 1,703
  • 2
  • 10
  • 7
159
votes
17 answers

Autoincrement VersionCode with gradle extra properties

I'm building an Android app with gradle. Until now I used the Manifest file to increase the versionCode, but I would like to read the versionCode from an external file and depending if it is the release flavor or the debug flavor increase the…
carvaq
  • 1,816
  • 3
  • 16
  • 21
158
votes
5 answers

How to disable gradle 'offline mode' in android studio?

I am new to android studio IDE development. Every time when I imported a sample project that developed in the android studio, I am getting this error.. No cached version of com.android.tools.build:gradle:1.1.0 available for offline mode. Disable…
Loganathan
  • 1,864
  • 3
  • 12
  • 17
156
votes
17 answers

Multidex issue with Flutter

I'm getting the following error compiling with gradle using Flutter in Android Studio: Dex: Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/zzcew; UNEXPECTED TOP-LEVEL…
SpoonerNZ
  • 1,705
  • 2
  • 11
  • 8
156
votes
21 answers

Kotlin Error : Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7:1.0.7

I installed the Kotlin plugin into my app (v. v1.1.1-release-Studio2.2-1) and then selected "Configure Kotlin in Project" I selected compiler and runtime version of 1.0.7. Kotlin updated my Gradle files. Now when I try to build in I get: Error: A…
Mike6679
  • 5,547
  • 19
  • 63
  • 108
155
votes
17 answers

Gradle - Error Could not find method implementation() for arguments [com.android.support:appcompat-v7:26.0.0]

I am trying to open existing android project in android studio and it gradle cannot build the app without the error Error android studio keeps on throwing Error:(74, 1) A problem occurred evaluating project ':app'. > Could not find method…
cole
  • 3,147
  • 3
  • 15
  • 28
154
votes
31 answers

Gradle, Android and the ANDROID_HOME SDK location

edit: (aug-2016) That question is from November 2013 (while Android Studio was still in Developer Preview mode), Currently (AS v2.2, Aug-2016) during instalation AS asks to choose the SDK folder (or install on their default) and it automatically…
Budius
  • 39,391
  • 16
  • 102
  • 144
150
votes
5 answers

Could not find method leftShift() for arguments after updating studio 3.4

After updating studio 3.4 and Gradle version to 5.1.1 I got the error on my task as Could not find method leftShift() My task: task incrementBetaVersion << { println("Incrementing Beta Version Number...") …
Bhuvanesh BS
  • 13,474
  • 12
  • 40
  • 66
148
votes
8 answers

Could not find method kapt() for arguments

I'm facing a problem for over 3 days now and I can't solve. since I started to use Kotlin for Android,I stopped using "annotationProcessor" and started using "kapt", all things were working great with kapt until I started to build an Android Instant…
146
votes
8 answers

Error :: duplicate files during packaging of APK

Android Studio. I'm getting this kind of error during application run. Error:Execution failed for task ':app:packageDebug'. Duplicate files copied in APK META-INF/notice.txt build.gradle apply plugin: 'android' android { compileSdkVersion 19 …
Robertas Setkus
  • 3,075
  • 6
  • 31
  • 54