Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to apply plugin Android Gradle plugin 3.0.0-alpha5 must not be applied to project

Using the latest Android Studio 3.0 Canary 5

Here's the error:

Error:(1, 1) A problem occurred evaluating project ':app'.

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

Tried: cleaning, rebuilding, opening/closing. Not working.

any ideas ?

[LATER EDIT] Solution: Migrate to Canary 8+ and all should be ok.

like image 394
OWADVL Avatar asked Jul 01 '17 03:07

OWADVL


3 Answers

From this reddit thread, killing daemons fixed the problem for me.

./gradlew --stop
like image 150
Hadi Tok Avatar answered Nov 11 '22 16:11

Hadi Tok


This worked for me:

Deactivate Configuration On Demand

In gradle.properties:

org.gradle.configureondemand=false

Then stop the daemon in a terminal window:

gradlew.bat --stop

Now everything works again.

Versions used:

  • 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 reactivate Configuration on Demand and everything works fine.

like image 39
TmTron Avatar answered Nov 11 '22 16:11

TmTron


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

like image 1
al_mukthar Avatar answered Nov 11 '22 16:11

al_mukthar