작성자 없음
작성자 정보가 삭제된 글입니다.
작성
·
206
0
그 전에는 이런 일이 없었는데 요번 프로젝트에서 이 에러가 떠서 진행하지 못하고 있습니다.
제가 시도 해본 것들
JDK21 설치 (환경 변수 설정까지)
JDK17설치 (환경 변수 설정까지)
flutter clean, flutter pub get
API 34, 35 둘 다 실행, 다른 프로젝트에서는 변함없이 잘 됩니다.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':webview_flutter_android:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':webview_flutter_android:androidJdkImage'.
> Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JdkImageTransform: C:\Users\82106\AppData\Local\Android\sdk\platforms\android-34\core-for-system-modules.jar.
> Error while executing process C:\Program Files\Android\Android Studio\jbr\bin\jlink.exe with arguments {--module-path C:\Users\82106\.gradle\caches\transforms-3\fb247f22548bfd545efa0cbc10d96775\transformed\output\temp\jmod --add-modules java.base --output C:\Users\82106\.gradle\caches\transforms-3\fb247f22548bfd545efa0cbc10d96775\transformed\output\jdkImage --disable-plugin system-modules}
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 28s
┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────────┐
│ [!] This is likely due to a known bug in Android Gradle Plugin (AGP) versions less than 8.2.1, │
│ when │
│ 1. setting a value for SourceCompatibility and │
│ 2. using Java 21 or above. │
│ To fix this error, please upgrade your AGP version to at least 8.2.1. The version of AGP that │
│ your project uses is likely defined in: │
│ C:\Users\82106\webview\android\settings.gradle, │
│ in the 'plugins' closure (by the number following "com.android.application"). │
│ Alternatively, if your project was created with an older version of the templates, it is likely │
│ in the buildscript.dependencies closure of the top-level build.gradle: │
│ C:\Users\82106\webview\android\build.gradle, │
│ as the number following "com.android.tools.build:gradle:". │
│ │
│ For more information, see: │
│ https://issuetracker.google.com/issues/294137077 │
│ https://github.com/flutter/flutter/issues/156304 │
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
답변 2
0
안녕하세요!
Java 17 버전 사용해야하는 상황이 맞는걸로 보입니다.
flutter config --jdk-dir 또한 17 버전으로 다이렉트 해주세요.
잘 안된다면 카카오채널에서 원격신청 부탁드립니다.
감사합니다!
0
안녕하세요, 인프런 AI 인턴입니다. kangkyubin3님.
현재 JDK 및 Android Gradle Plugin(AGP) 관련 오류를 경험하고 계시는군요. 이 문제는 주로 AGP 버전과 사용 중인 JDK 버전의 호환성 문제로 인해 발생할 수 있습니다. 특정한 Gradle 및 Android 빌드 도구 설정을 수정하는 것이 필요한 상황입니다.
android/build.gradle
파일 또는 android/settings.gradle
파일을 열어, 아래와 같이 플러그인 버전을 수정하세요. buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:8.2.1'
}
}
JDK 버전 확인:
JAVA_HOME
환경 변수와 Android Studio의 Project Structure
내 JDK Location
경로가 일치하는지 확인해주세요.Gradle 캐시 정리:
gradlew clean
명령어를 실행하여 Gradle 캐시를 비우고, 다시 빌드 과정을 진행하세요.플러그인 및 Dependency 최신화:
pubspec.yaml
및 build.gradle
내의 모든 의존성을 최신 버전으로 업데이트하고, flutter pub get
명령어를 통해 프로젝트를 재설정하세요.아래 유사한 문제를 해결한 게시물 링크를 참조하시면 추가적인 정보와 해결 방안을 확인할 수 있습니다:
- 웹뷰(Webview) 패키지 디버깅, 빌드 안 됨 문의드립니다.
- 안드로이드 실행하면 에러가 납니다.
이와 같은 방법을 통해 문제를 진단 및 해결해 보시고, 추가적인 질문이 있으시면 언제든지 문의해 주세요.
저는 질문자님의 이해를 돕고자 지식공유자님의 기존 답변을 참고하여 유사한 답변 링크를 추천해드리고 있습니다.
현재 베타 기능으로 답변이 만족스럽지 않을 수 있는 점 양해 부탁드립니다. 🙏 추가적으로 궁금한 점이 있으시면, 이어서 질문해 주세요. 곧 지식공유자께서 답변해 주실 것입니다.