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
143
votes
23 answers

Indexing freeze with message: Indexing paused due to batch updated

I've updated Android Studio to version 3.2. After that update one of my projects don't want to index. It freezes with the message "Indexing paused due to batch update". How can I fix this? File…
Axbor Axrorov
  • 2,720
  • 2
  • 17
  • 35
143
votes
6 answers

What are the differences between gradle assemble and gradle build tasks?

If I am not wrong gradle assemble does run gradle assembleDebug and gradle assembleRelease, but I believe gradle build also does the same, so what are the different between them both?
Humble Student
  • 3,755
  • 4
  • 20
  • 35
143
votes
13 answers

how can I add the aidl file to Android studio (from the in-app billing example)

I am currently migrating an Eclipse app to Android Studio. This app was using the in app billing. My main problem is to compile the project and the aidl file (I guess you all use this file) I get this error message: Gradle: error: cannot find…
Waza_Be
  • 39,407
  • 49
  • 186
  • 260
140
votes
10 answers

Unable to load class AndroidComponentsExtension after upgrading the Android Gradle Plugin 7.1

I recently downloaded Android Studio Bumblebee and it helpfully asked whether I wanted to upgrade to Android Gradle Plugin 7.1.0, the version that shipped alongside Android Studio Bumblebee. After upgrading, I get a build error: Unable to load class…
140
votes
22 answers

Error building Android library: Direct local .aar file dependencies are not supported

We recently upgraded to Android Gradle Plugin 4.0.0-beta03. We are now seeing this error when building one of our library modules $ ./gradlew library_module:assemble Execution failed for task ':library_module:bundleDebugAar'. > Direct local .aar…
tir38
  • 9,810
  • 10
  • 64
  • 107
139
votes
49 answers

Error:com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

This is the output of my Gradle console, I am unable to build my project D:\Android Projects\....\app\src\main\res\layout\topic_view_header.xml Error:error: resource attr/?? (aka -packagename- :attr/??) not found. Error:error: resource attr/?? (aka…
Zeeshan Ali
  • 2,211
  • 4
  • 18
  • 25
138
votes
34 answers

Android Studio - Failed to apply plugin [id 'com.android.application']

I am working on an app. In my app there is no error in code but when I try to run my project it gives following errors. Error:(1, 1) A problem occurred evaluating project ':app'. Failed to apply plugin [id 'com.android.application'] Could not…
Praval Sharma
  • 1,921
  • 2
  • 14
  • 20
138
votes
1 answer

Error:Jack is required to support java 8 language features

When I tried to update my android project to use Java 8 after getting android studio 2.1 and android N SDK by adding compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } I had this…
humazed
  • 74,687
  • 32
  • 99
  • 138
138
votes
10 answers

How do I read properties defined in local.properties in build.gradle

I have set sdk.dir and ndk.dir in local.properties. How do I read the values of sdk.dir and ndk.dir in the build.gradle file?
Vikram
  • 11,885
  • 5
  • 22
  • 16
137
votes
8 answers

Error:(26, 0) Gradle DSL method not found: 'runProguard()'

I'm using android studio 0.9.3 with gradle 'com.android.tools.build:gradle:0.14.+' apply plugin: 'com.android.application' android { compileSdkVersion 19 buildToolsVersion '20.0.0' defaultConfig { applicationId "xxx.xxx.xxx" …
NickF
  • 5,637
  • 12
  • 44
  • 75
134
votes
11 answers

"No cached version... available for offline mode."

I received an error message while building a new Hello World project in Android Studio: FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'MyApplication2'. > Could not resolve all dependencies…
robin
  • 1,481
  • 2
  • 10
  • 4
131
votes
14 answers

Using build types in Gradle to run same app that uses ContentProvider on one device

I have set up Gradle to add package name suffix to my debug app so I could have release version that I'm using and debug version on one phone. I was referencing this: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Types My…
MantasV
  • 1,485
  • 3
  • 11
  • 9
130
votes
25 answers

Android Studio Gradle: Error:Execution failed for task ':app:processDebugGoogleServices'. > No matching client found for package

I am trying to upgrade my google play services dependencies to 8.4.0 by following the example Google gives here, but I am getting the following error ('com.example.exampleapp' is a replacement for my app package name): Error:Execution failed for…
129
votes
2 answers

Why are there two build.gradle files in an Android Studio project?

After having imported an Eclipse project into Android Studio, I see two build.gradle files: 1 - \build.gradle 2 - \app\build.gradle The first version is shorter, the second version contains definitions for…
Sabuncu
  • 5,095
  • 5
  • 55
  • 89
125
votes
21 answers

Copy existing project with a new name in Android Studio

I would like to copy my Android project and create a new project from the same files just with a different name. The purpose of this is so I can have a second version of my app which is ad supported in the app store. I found this answer…
Mike
  • 6,751
  • 23
  • 75
  • 132