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
190
votes
2 answers

Android gradle: buildtoolsVersion vs compileSdkVersion

What's the difference between buildtoolsVersion vs compileSdkVersion in the build.gradle for an Android project? EDIT: Specifically, I'd like clarification on what the build tool is?
Glide
  • 20,235
  • 26
  • 86
  • 135
189
votes
42 answers

Error: Execution failed for task ':app:clean'. Unable to delete file

I'm trying to rebuild my Android Studio Gradle project (containing mostly Kotlin code), but it started to throw an UnableToDeleteFileException during the cleaning/rebuilding process: Execution failed for task ':app:clean'. > Unable to delete file:…
189
votes
15 answers

Tools: replace not replacing in Android manifest

I am using a gradle project with many different library dependencies and using the new manifest merger. In my tag I have it set up as such:
Andrew Grosner
  • 2,337
  • 2
  • 18
  • 14
186
votes
17 answers

How to set versionName in APK filename using gradle?

I'm trying to set a specific version number in the gradle auto-generated APK filename. Now gradle generates myapp-release.apk but I want it to look something like myapp-release-1.0.apk. I have tried renaming options that seems messy. Is there a…
Coy
  • 3,703
  • 3
  • 14
  • 13
185
votes
24 answers

error: resource android:attr/fontVariationSettings not found

Warning:The android.dexOptions.incremental property is deprecated and it has no effect on the build process. /home/midhilaj/.gradle/caches/transforms-1/files-1.1/appcompat-v7-26.1.0.aar/be3106efb0df111fe5a3f7b356dd070b/res/values/values.xml …
Midhilaj
  • 4,905
  • 9
  • 45
  • 88
184
votes
40 answers

com.google.android.gms:play-services-measurement-base is being requested by various other libraries

I updated to gradle 4.0.1 and started receiving following error The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.4,15.0.4]], but resolves to 15.0.2. Disable the plugin and…
Ilja
  • 44,142
  • 92
  • 275
  • 498
184
votes
14 answers

Build Android Studio app via command line

I want to build an Android Studio app (the Gradle build system), but I want to do this via the command line.
183
votes
33 answers

Error running android: Gradle project sync failed. Please fix your project and try again

Android Studio (1.2 RC0) keeps telling me Error running android: Gradle project sync failed. Please fix your project and try again. How can I find out what the problem is? Unfortunately the solutions from this SO thread did not help.
SePröbläm
  • 5,142
  • 6
  • 31
  • 45
182
votes
2 answers

Access to 'viewBinding' exceeds its access rights

After updating Android Studio to Arctic Fox and Android Gradle plugin to 7.0.0 I'm facing this warning, I mean the app can be built successfully nonetheless of this warning but what I am missing here? What's the problem here? According to the…
178
votes
17 answers

Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to

today I just imported a sample app from Android SDK as a module in my project (analytics) and suddenly I got this gradle error when I try to sync it: Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE envrinment…
Mario Norato
  • 1,871
  • 2
  • 12
  • 12
178
votes
15 answers

Adding local .aar files to Gradle build using "flatDirs" is not working

I'm aware of this question: Adding local .aar files to my gradle build but the solution does not work for me. I tried adding this statement to the top level of my build.gradle file: repositories { mavenCentral() flatDir { dirs…
177
votes
9 answers

spawnSync ./gradlew EACCES error when running react native project on emulator

I am trying to use react-native run-android to install my react-native application on an android studio emulator. I have checked with abd-devices that the emulator is available, and I have ran npm-install. I am using Ubuntu 18.04 with the…
dudeperryfect
  • 1,787
  • 2
  • 7
  • 6
176
votes
7 answers

How can I access a BuildConfig value in my AndroidManifest.xml file?

Is it possible to access a BuildConfig value from AndroidManifest.xml? In my build.gradle file, I have: defaultConfig { applicationId "com.compagny.product" minSdkVersion 16 targetSdkVersion 21 versionCode 1 versionName "1.0" …
anthony
  • 7,653
  • 8
  • 49
  • 101
176
votes
11 answers

How to change app name per Gradle build type

I am trying to figure out a way to be able to change my application's app name per build type in gradle. For instance, I would like the debug version to have -debug and the qa version to have -QA. I am familiar with: debug { …
Andre Perkins
  • 7,640
  • 6
  • 25
  • 39
175
votes
32 answers

Android studio 3.0: Unable to resolve dependency for :app@dexOptions/compileClasspath': Could not resolve project :animators

I migrate to Android studio 3.0. So, the project become unable to compile a module named ":animator" and it displays me this error: Error:Unable to resolve dependency for ':app@dexOptions/compileClasspath': Could not resolve project :animators.…