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
313
votes
12 answers

Configuration on demand is not supported by the current version of the Android Gradle plugin

After upgrading to Android Studio 3.1.2 I am getting the following error: Configuration on demand is not supported by the current version of the Android Gradle plugin since you are using Gradle version 4.6 or above. Suggestion: disable…
Dick Lucas
  • 12,289
  • 14
  • 49
  • 76
287
votes
27 answers

Could not find or load main class org.gradle.wrapper.GradleWrapperMain

I cleaned the whole project by deleting local directories like ~/.gradle, ~/.m2 ~./android and ~/workspace/project/.gradle and chosing File -> Invalidate Caches / Restart... in Android Studio. Now execution of the command ./gradlew leads to the…
SePröbläm
  • 5,142
  • 6
  • 31
  • 45
277
votes
55 answers

Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

I want to compile an open source android project (Netguard) using gradel (gradlew clean build) But I encountered this Error: A problem occurred configuring project ':app'. > Exception thrown while executing model rule:…
Saeed
  • 7,262
  • 14
  • 43
  • 63
275
votes
15 answers

Android Gradle Apache HttpClient does not exist?

I am trying to convert an IntelliJ project to the Gradle system of Android Studio but I am running into errors with Apache HttpClient? Am I missing something, the errors I am getting are as follows: Error:(10, 30) error: package…
Apqu
  • 4,880
  • 8
  • 42
  • 68
261
votes
19 answers

Android Studio Gradle Already disposed Module

I have installed Android Studio version 1.0.1. I have imported my projects from eclipse and it works fine. Then I deleted a module and reimported it into my Android Studio project. The gradle build says "BUILD SUCCESSFUL" but it pops up an alert…
Zenco
  • 2,963
  • 3
  • 17
  • 22
253
votes
28 answers

"Gradle Version 2.10 is required." Error

As I've been using classpath 'com.android.tools.build:gradle:+' In the build.gradle file, I got the following error since gradle version 2.10 has been released. The error is : Warning:Gradle version 2.10 is required. Current version is 2.8. If …
246
votes
15 answers

Error:Conflict with dependency 'com.google.code.findbugs:jsr305'

I created a new project in Android Studio 2.2 Preview 1 with Android App and Backend module with Google Messaging. This is the app file: apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" …
245
votes
30 answers

How to set gradle home while importing existing project in Android studio

How to set gradle home while importing existing project in Android studio. While trying to import I need to set up this path.
Deniz
  • 12,332
  • 10
  • 44
  • 62
244
votes
31 answers

ViewModelProviders is deprecated in 1.1.0

Looking at the Google docs for ViewModel, they show the below sample code on how to get a ViewModel: val model = ViewModelProviders.of(this).get(MyViewModel::class.java) When using the latest dependency android.arch.lifecycle:extensions:1.1.1 there…
244
votes
19 answers

buildTypes cannot be applied to groovy.lang.Closure

I'm getting this warning in my project gradle file: Warning:(16, 5) 'buildTypes' cannot be applied to '(groovy.lang.Closure< com.android.build.gradle.internal.dsl.BuildType>)' My buildTypes section is: buildTypes { debug { …
Jim Vitek
  • 4,174
  • 3
  • 23
  • 32
242
votes
4 answers

Android buildscript repositories: jcenter VS mavencentral

The last time I used Android Studio, it generated .gradle files with mavencentral() buildscript repositories whereas now there's jcenter(). Could anyone explain the issues connected with this. Are there any other repos? When should we switch them?…
Jacob
  • 14,949
  • 19
  • 51
  • 74
241
votes
25 answers

No version of NDK matched the requested version

After updating to Android Gradle plugin 3.6.0 (released Feb 24, 2020), several project independently started failing with: No version of NDK matched the requested version 20.0.5594570. Versions available locally: 21.0.6113669 It's quite simple to…
241
votes
35 answers

Android Material and appcompat Manifest merger failed

I have next grade dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:28.0.0-rc01' implementation 'com.android.support.constraint:constraint-layout:1.1.2' …
237
votes
28 answers

Manifest merger failed : uses-sdk:minSdkVersion 14

Since downloading the latest SDK and installing Android Studio, my project fails to build. I get the following message: Error:Gradle: Execution failed for task ':SampleProject:processProdDebugManifest'. > Manifest merger failed :…
loeschg
  • 29,961
  • 26
  • 97
  • 150
233
votes
36 answers

It is currently in use by another Gradle instance

I want to do some basic functions. I'm running/building it in command line. I am referring User guide. And, doing some simple tasks. When I start to run simple tasks, it was build successfully. But, After some times, it is showing "It is currently…
Dhasneem
  • 4,037
  • 4
  • 33
  • 47