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

后端 未结 7 579

Using the latest Android Studio 3.0 Canary 5

Here\'s the error:

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

Failed to app

相关标签:
7条回答
  • 2021-02-03 18:35

    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.

    0 讨论(0)
  • 2021-02-03 18:38

    I got the issue and realized the issue related with caches. You have to invalidate caches of Android studio by select File-> Invalidate Caches/Restart. It worked for me. The issue was resolved.

    0 讨论(0)
  • 2021-02-03 18:42

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

    0 讨论(0)
  • 2021-02-03 18:50

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

    ./gradlew --stop
    
    0 讨论(0)
  • 2021-02-03 18:53

    I already tried all the solutions including Clean, Rebuild, Invalidate Project

    But nothing is working but i figured it out.

    For temporary just downgrade your 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.. :)

    0 讨论(0)
  • 2021-02-03 18:55

    Open a terminal and write

    ./gradlew --stop 
    

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

    Notice that there are no custom jvmargs...

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

    Include the google() repo in build.gradle (project one)

    there's how mine look 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
    }
    

    lastly the support library versions in the app build.gradle file

    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 讨论(0)
提交回复
热议问题