Failed to apply Android Gradle plugin. 3.0.0-alpha5 plugin should not be applied to the project

Using the latest version of Android Studio 3.0 Canary 5

Here's the error:

Error: (1, 1) There was a problem evaluating the project ': app'.

Failed to apply plugin [class 'com.android.build.gradle.api.AndroidBasePlugin'] Android Gradle plugin 3.0.0-alpha5 should not be applied to the project [path_to_my_project], since version 3.0.0-alpha5 has already been applied to this project

Tried: cleaning, rebuilding, opening / closing. Does not work.

any ideas?

[LATER EDIT] Solution: Go to Canary 8+ and everything should be in order.

+43
android android gradle
Jul 01 '17 at 3:59
source share
7 answers

from this thread on reddit: https://www.reddit.com/r/androiddev/comments/6kjl8b/android_studio_30_canary_5_is_now_available/djmuv0o/ killing demons fixed the problem for me.

./gradlew --stop 
+39
Jul 01 '17 at 6:51
source share
— -

This worked for me:

Deactivate Configuration on Demand

In gradle.properties :

 org.gradle.configureondemand=false 

Then stop the daemon in the terminal window:

 gradlew.bat --stop 

Now everything works again.

Used Versions:

  • Android Studio 3.0 Canary 5
  • gradle: gradle-4.1-milestone-1
  • android gradle plugin: com.android.tools.build:gradle:3.0.0-alpha5

UPDATE
After upgrading to Android Studio 3.0 Beta 2, I can activate the configuration on demand, and everything works fine.

+21
Jul 01 '17 at 8:43 on
source share

Migrating the gradle version from 3.0.0-alpha5 to 3.0.0-alpha7 saved my day!

+1
Jul 21 '17 at 6:57
source share

Open a terminal and write

 ./gradlew --stop 

In gradle.properties make sure you don't have funny stuff

Please note that there are no custom jvmargs ...

 org.gradle.daemon=true org.gradle.parallel=true org.gradle.configureondemand=false 

Include google () repository in build.gradle (single project)

there how mine looks like

build.gradle

 // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter() google() maven { url "http://objectbox.net/beta-repo/" } } dependencies { classpath 'io.objectbox:objectbox-gradle-plugin:0.9.12.1' classpath 'com.android.tools.build:gradle:3.0.0-alpha5' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { maven { url 'https://jitpack.io' } jcenter() google() maven { url "http://objectbox.net/beta-repo/" } } } task clean(type: Delete) { delete rootProject.buildDir } 

Finally, the support library versions in the build.gradle file of the application

build.gradle

 ... //----- Support Libs implementation 'com.android.support:appcompat-v7:26.0.0-beta2' implementation "com.android.support:design:26.0.0-beta2" implementation "com.android.support:recyclerview-v7:26.0.0-beta2" implementation "com.android.support:cardview-v7:26.0.0-beta2" ... 
0
Jul 01 '17 at 6:44
source share

I had a problem and I understood the problem with caches. You must invalidate Android Studio caches by choosing File-> Invalid Cache / Restart. It worked for me. The problem was solved.

0
Jul 01 '17 at 6:49
source share

I had the same problem, I closed Android Studio and opened again, I noticed that it automatically applied these changes to the following files, and everything worked fine:

build.gradle : changed the Gradle class path from:

 dependencies { classpath 'com.android.tools.build:gradle:2.3.1' } 

to

 dependencies { classpath 'com.android.tools.build:gradle:3.0.0-alpha5' } 

gradle -wrapper.properties : from

 distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip 

to

 distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-milestone-1-all.zip 
0
Aug 28 '17 at 12:34 on
source share

I have already tried all solutions, including Clean, Rebuild, Invalid project

But nothing works, but I figured it out.

For temporary just uncheck gradle plugin version to stable version

 classpath 'com.android.tools.build:gradle:2.3.2' 

Replace your alpha line with this line. And have fun .. :)

-3
Jul 01 '17 at 4:55 on
source share



All Articles