admin管理员组文章数量:1386742
When I run my flutter project in android I am facing a build failure because of the gradle version. I am already using java version 17.0.4 (jdk-17). Here is the error:
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':flutter_plugin_android_lifecycle:compileDebugJavaWithJavac'.
Could not resolve all files for configuration ':flutter_plugin_android_lifecycle:androidJdkImage'. Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, .gradle.libraryelements=jar, .gradle.usage=java-runtime}. > Execution failed for JdkImageTransform: C:\Users\SOURASHIS\AppData\Local\Android\sdk\platforms\android-35\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\SOURASHIS.gradle\caches\transforms-3\291f276a94cea6743b33cc7b0cfd9380\transformed\output\temp\jmod --add-modules java.base --output C:\Users\SOURASHIS.gradle\caches\transforms-3\291f276a94cea6743b33cc7b0cfd9380\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 .
BUILD FAILED in 38s
┌─ 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\SOURASHIS\Notebrains\app_flutter_rallyup_event_goers\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\SOURASHIS\Notebrains\app_flutter_rallyup_event_goers\android\build.gradle, │ │ as the number following "com.android.tools.build:gradle:". │ │ │ │ For more information, see: │ │ │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘ Error: Gradle task assembleDebug failed with exit code 1
This is not the 1st time but everytime it is showing a new error.
How can I fix these types of errors. I need a proper solution.
本文标签: javaFacing a build failure when I run my Flutter Project in androidStack Overflow
版权声明:本文标题:java - Facing a build failure when I run my Flutter Project in android - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744525467a2610720.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论