mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
![]() Fixes https://github.com/flutter/flutter/issues/156304. Also fixes https://github.com/flutter/flutter/issues/155449. Unfortunately, because the error handler only sees one line at a time, it is hard to make this handling any more specific than this. If we run in to another jlink related error (unlikely) between now and when we phase out support for AGP 8.2.0 and below, we might have trouble differentiating them. We should delete the error handler when we phase out support for those versions. Example of handled error output: ``` FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':shared_preferences_android:compileReleaseJavaWithJavac'. > Could not resolve all files for configuration ':shared_preferences_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: /Users/mackall/Library/Android/sdk/platforms/android-34/core-for-system-modules.jar. > Error while executing process /Users/mackall/Desktop/JDKs/21/jdk-21.0.2.jdk/Contents/Home/bin/jlink with arguments {--module-path /Users/mackall/.gradle/caches/8.9/transforms/2890fec03da42154757073d3208548e5-79660961-f91d-4df2-90bc-b9a3f2a270bd/transformed/output/temp/jmod --add-modules java.base --output /Users/mackall/.gradle/caches/8.9/transforms/2890fec03da42154757073d3208548e5-79660961-f91d-4df2-90bc-b9a3f2a270bd/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 1s Running Gradle task 'assembleRelease'... 2,100ms ââ 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: â â /Users/mackall/development/BugTesting/fifth/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: â â /Users/mackall/development/BugTesting/fifth/android/build.gradle, â â by the number following "com.android.tools.build:gradle:". â â â â For more information, see: â â https://b.corp.google.com/issues/294137077 â â https://github.com/flutter/flutter/issues/156304 â âââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââââ Gradle task assembleRelease failed with exit code 1 ``` |
||
---|---|---|
.. | ||
android_java11_integration.shard | ||
android_preview_integration.shard | ||
commands.shard | ||
data | ||
general.shard | ||
host_cross_arch.shard | ||
integration.shard | ||
src | ||
web.shard |