Hey guys, I'm encountering a build error in my Flu...
# community-support
d
Hey guys, I'm encountering a build error in my Flutter project that persists despite trying several solutions. Here's the situation: FAILURE: Build failed with an exception. * What went wrong: Execution failed for task 'path provider androidcompileDebugJavaWithJavac'.
Could not resolve all files for configuration 'path provider androidandroidJdkImage'.
> 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\divze\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\divze\.gradle\caches\transforms-4\27e36688d75713520a548ce4f512569d-3b10661d-8c74-445a-b70e-b918ddd75202\transformed\output\temp\jmod --add-modules java.base --output C:\Users\divze\.gradle\caches\transforms-4\27e36688d75713520a548ce4f512569d-3b10661d-8c74-445a-b70e-b918ddd75202\transformed\output\jdkImage --disable-plugin system-modules}. Environment: • Android Studio Hedgehog (LadyBug) • Android SDK 34 (ext.7) • Initially using JDK 8 • Gradle 8.3 (also tried 8.6) • Latest Flutter version Steps Tried: 1. Installed JDK 17 as recommended for newer Gradle versions 2. Updated build.gradle with Java 17 compatibility: compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = '17' }Tried downgrading Gradle to 7.5 Ran
flutter clean
and
flutter pub get
Updated JAVA_HOME but still getting. Please has anyone encounter such challenge and how did you overcome it.
v
That's not so much a Gradle issue actually. Flutter or AGP try to run some artifact transform that calls jlink which fails. Try scrolling up to see the actual error or running with
--info
or
--debug
to maybe get more information. you could also try to execute the shown jlink command manually from the commandline to maybe see the actual error that is happening.