본문 바로가기

ANDROID/Debug Logs

[안드로이드] Unsupported method: AndroidProject.getPluginGeneration(). The version of Gradle you connect to does not support that method. To resolve the problem you can change/upgrade the target version of Gradle you conne..

< 오늘 발생한 오류 두가지 >


 Unsupported method: AndroidProject.getPluginGeneration().              

The version of Gradle you connect to does not support that method.              

To resolve the problem you can change/upgrade the target version of Gradle you connect to.              

Alternatively, you can ignore this exception and read other information from the model 


.Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.



시간이 더 되보이는 프로젝트들을 받고 빌드 하는 중 다음과 같은 오류들이 발생해 프로젝트의 Gradle Scripts에 존재하는 


build.gradle 코드와 gradle-wrapper.properties 등을 손대야 했다. 




먼저 첫번째 오류


 Unsupported method: AndroidProject.getPluginGeneration().              

The version of Gradle you connect to does not support that method.              

To resolve the problem you can change/upgrade the target version of Gradle you connect to.              

Alternatively, you can ignore this exception and read other information from the model 


먼저 build.gradle 코드의 dependencies 에 표시되어있는 classpath를 봤을 때, 1.0.0대나 어쨌건 더 낮은 버전으로 설정이 되있을 수 있다.


일단 아래처럼 2.2.0이나 2.3.0 으로 바꾸어 다시 빌드를 한다.


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

다음 빌드부터는 본격적으로 마우스만 클릭하면 되는데, 무슨 얘기냐하면 안드로이드 스튜디오에서 추가로 수행해야 할 작업들을 모두 제시해준다는 점이다.


새로 path를 업데이트 하라느니, 빌드 툴을 업데이트나 업그레이드 하라느니 등등, 해야할 일들을 주치의처럼 차례차례 제시해 준다.


무슨 메세지가 나오던 간에 하라는대로 클릭질과 OK로 업데이트를 마치면 빌드가 원활이 이루어지게 된다.



두번째 오류


.Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.


클래스 패스를 잡지 못한다느니 싶은 오류가 나왔을 때 gradle-wrapper.properties에 있는 distributionUrl을 아래와 같이 바꿔준다.



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



그 이후 빌드를 다시하면 위 오류와 마찬가지로 안드로이드 스튜디오가 해야 할 일들을 하라고 제안하고, 이것들을 모두 클릭해 더이상


오류가 뜨지 않을때까지 계속하면 된다.



내생각에는 안드로이드 스튜디오가 프로젝트를 자동으로 실행 가능한 버전정도로 업데이트를 하기위해 인식하도록 한


버전범위에 속하지도 않아 이를 업데이트 한다기 보단 그냥 오류메세지로 땡처리를 하고 있는것이 아닌가 생각이 든다.