Learn to share,Share to learn
Android gradle Plugin 7.4.2와 Java 8 호환문제 본문
오늘은 팀원과 함께 코딩하러 십만년만에 학교로 올라갔다
그런데 생각치도 못한 문제가 발목을 잡기 시작했는데..
A problem occurred configuring root project 'pathfinder'. > Could not resolve all files for configuration ':classpath'. > Could not resolve com.android.tools.build:gradle:7.4.2. Required by: project : > com.android.application:com.android.application.gradle.plugin:7.4.2 project : > com.android.library:com.android.library.gradle.plugin:7.4.2 > No matching variant of com.android.tools.build:gradle:7.4.2 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5' but: - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally: - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8 - Other compatible attribute: - Doesn't say anything about org.gradle.plugin.api-version (required '7.5') - Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally: - Incompatible because this component declares documentation and the consumer needed a library - Other compatible attributes: - Doesn't say anything about its target Java version (required compatibility with Java 8) - Doesn't say anything about its elements (required them packaged as a jar) - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')
아파서 노트북을 워낙 오래 못켜서 방전된것도 서러운데 집 컴퓨터랑 빌드환경까지 달라서 문제가 생긴거다. 금방 해결할줄 알았건만 한참걸렸다. 왜냐??
지정된 Android Gradle 플러그인 버전과 사용 중인 Java 버전 간의 호환성 문제가 있습니다. Android Gradle 플러그인 버전 7.4.2는 Java 11과 호환되는 것으로 보이지만, 귀하의 프로젝트 설정은 Java 8과 함께 이를 해결하려고 합니다.
내 자바가 버전이 낮다고 한다. 그럼 업데이트 해야지
https://coding-factory.tistory.com/824
[Java] 자바 최신 버전 수동 업데이트 방법
자바로 개발되어있는 프로그램을 실행시키기 위해서는 컴퓨터에 자바가 설치되어 있어야 합니다. 하지만 가끔 구버전의 자바를 사용하고 있어 프로그램들이 정상적으로 실행되지 않는 경우들
coding-factory.tistory.com
를 보고 업데이트 했는데도 해결이 안됐다
삭제후 재설치도 해봤는데 해결이 안됐다
java와 jdk를 3개를 설치를 했는데도 안됐다?? 거참..
그래서 혹시 하는생각에 재부팅도 먹히지 않고.. 그러다 마지막으로 시도한게
안드로이드 스튜디오가 거의 3년전에 깔았던 버전이라 자바를 못 찾나 싶어 재설치를 해봤다
3년만에 신규 업데이트를 해준셈이니 뭐라도 되겠지?? 당연히 됐다.
결국 안드로이드 스튜디오를 최신버전으로 까니 해결된거다...
문제는 내 2017년에 산 한성 노트북이 맛이 가기 직전이란거다
다시 설치하고 run을 해보려고 했건만 1시간동안 공회전이나 하다 퍼졌다
그렇게 그램을 주문했고.. 팀원분께는 밥을 사드렸다...
아파서 2년간 노트북을 켜보지도 못했으니 뭐.. 이럴걸 예상했어야했는데 이런..
'그 외 > 기타' 카테고리의 다른 글
> Task :app:kaptGenerateStubsDebugKotlin FAILED 해결법 How to fix > Task :app:kaptGenerateStubsDebugKotlin FAILED (0) | 2023.11.28 |
---|