Unsupported method: AndroidProject.getPluginGeneration() while running project

后端 未结 7 1157
青春惊慌失措
青春惊慌失措 2020-12-07 15:20

I\'m trying to run my Project with Android Studio 2.2 but I get this error

Unsupported method: AndroidProject.getPluginGeneration().
The version of Gradle yo         


        
相关标签:
7条回答
  • 2020-12-07 15:46

    Change gradle version to 2.2

    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
    }
    
    0 讨论(0)
  • 2020-12-07 15:53

    General Issue:-

    It can occur because AS was checking availability of the Instant Run feature. The fixed is to disable Instant Run:

    Windows & Linux:

    File -> Settings -> Build, Execution, Deployment -> Instant Run.
    

    Mac:

    Android Studio -> Preferences -> Build, Execution, Deployment -> Instant Run.
    

    Thanks to @pophus for mentioning this.

    Use this Steps If you are using a butterknife:-

    If you are using the new Jack compiler with version 2.2.0 or newer, you do not need the 'android-apt' plugin and can instead replace apt with annotationProcessor when declaring the compiler dependency.

    That is, remove

    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    

    from your main gradle file

    And remove

    apply plugin: 'android-apt'
    

    from your main module file

    and replace

    apt 'com.jakewharton:butterknife-compiler:8.4.0'
    

    with

    annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
    
    0 讨论(0)
  • 2020-12-07 15:53

    I encountered this error in Android Studio 2.2, in my case it was cause by AS checking availability of the Instant Run feature. I fixed it by disabling Instant Run:

    Android Studio -> Preferences -> Build, Execution, Deployment -> Instant Run

    0 讨论(0)
  • 2020-12-07 15:53

    just close instant run

    Windows File -Settings- Build, Execution, Deployment - Instant Run.

    MAC Android Studio -> Preferences -> Build, Execution, Deployment -> Instant Run.

    0 讨论(0)
  • 2020-12-07 15:55

    I ran in the same error on a very old project. Since Android Studio 3.5 does not have the Instant Run Option anymore, I required a different solution.

    It turned out, that I had to change the gradle version manually in the Project Settings. I used the version a New Project would use automatically, since the dropdowns were empty.

    In my case, it was Plugin Version 3.5.1 and Gradle Version 5.4.1.

    After that I started a Build - Clean Project and everything turned out fine.

    0 讨论(0)
  • 2020-12-07 16:01

    On Windows it is

    File / Settings/ Build, Execution, Deployment / Instant Run.
    

    Uncheck Enable Instant Run to hot swap code...

    0 讨论(0)
提交回复
热议问题