새로운 프로젝트를 생성하거나, clone해온 프로젝트들에서 해당 에러가 발생한다.
로그로 봐선 Could not resolve com.android.tools.build:gradle:8.0.1.
해당 부분이 유력한데, gradle의 버전을 바꿔봐도 해결되지 않았다. 로그를 더 살펴보니
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
위 내용의 에러를 발견. 지인에게 물어보니, 같은 경험해서 해결방법을 알려줬다!
Preference → Build, Execution, Deployment → Build Tools → Gradle
Gradle JDK에 난 맨위에 보이는 1.8(2) Amazon Correctto가 디폴트로 설정되어 있었다. 이 값을
Embedded JDK JetBrains Runtime
으로 수정하고 적용하면 해결된다.
에러로그를 쭉 훑어보는 계기가 된 것 같다. 특히 Java
나 target Java version
등 자바의 관련된 버전 관련 로그가 나온다면, 위 절차를 수행해 볼 것!