developer tip

지원되지 않는 메서드 : 프로젝트 실행 중 AndroidProject.getPluginGeneration ()

optionbox 2020. 8. 14. 07:40
반응형

지원되지 않는 메서드 : 프로젝트 실행 중 AndroidProject.getPluginGeneration ()


Android Studio 2.2로 프로젝트를 실행하려고하는데이 오류가 발생합니다.

Unsupported method: AndroidProject.getPluginGeneration().
The version of Gradle you connect to does not support that method.

ButterKnife 8.4.0을 사용하고 있습니다.

내 앱 gradle.file :

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    }
}

내 모듈 gradle 파일 :

apply plugin: 'com.android.application'
apply plugin: 'android-apt'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "xxx.xx"
        minSdkVersion 10
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
}

dependencies {
    compile 'com.jakewharton:butterknife:8.4.0'
    apt 'com.jakewharton:butterknife-compiler:8.4.0'
}

작동하지 않는 이유는 무엇이며 어떻게 해결합니까?


일반적인 문제 :-

AS가 Instant Run 기능의 가용성을 확인했기 때문에 발생할 수 있습니다. 해결 방법은 Instant Run을 비활성화하는 것입니다.

Windows 및 Linux :

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

맥:

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

여기에 이미지 설명 입력

이것을 언급 한 @pophus에게 감사합니다.

버터 나이프를 사용하는 경우이 단계를 사용하십시오.

버전 2.2.0 이상에서 새 Jack 컴파일러를 사용하는 경우 'android-apt'플러그인이 필요하지 않으며 대신 컴파일러 종속성을 선언 할 때 apt를 annotationProcessor로 바꿀 수 있습니다.

즉, 제거

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

기본 gradle 파일에서

그리고 제거

apply plugin: 'android-apt'

기본 모듈 파일에서

교체

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

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

Android Studio 2.2에서이 오류가 발생했습니다. 제 경우에는 AS가 Instant Run 기능의 가용성을 확인했기 때문입니다. Instant Run을 비활성화하여 수정했습니다.

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


gradle 버전을 2.2로 변경

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

Windows에서는

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

선택 취소 Enable Instant Run to hot swap code...


단지 가까운 즉시 실행

Windows 파일-설정-빌드, 실행, 배포-즉시 실행.

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

참고 URL : https://stackoverflow.com/questions/39591531/unsupported-method-androidproject-getplugingeneration-while-running-project

반응형