Temp Teen
Temp Teen

Reputation: 41

Flutter Build Failed: Execution Failed for Task ':path_provider_android:compileDebugJavaWithJavac' Due to JdkImageTransform Error

I'm encountering a build error while trying to run my Flutter project using Android Studio Hedgehog on Windows 11. The error specifically occurs during the :path_provider_android:compileDebugJavaWithJavac task and seems related to the JDK transformation process. Below is the error output:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':path_provider_android:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':path_provider_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\mtnoy\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\mtnoy\.gradle\caches\transforms-3\4a46fc89ed5f9adfe3afebf74eb8bfeb\transformed\output\temp\jmod --add-modules java.base --output C:\Users\mtnoy\.gradle\caches\transforms-3\4a46fc89ed5f9adfe3afebf74eb8bfeb\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 7s
Error: Gradle task assembleDebug failed with exit code 1

System Information:

What I've Tried:

  1. Updated Flutter SDK to the latest version.

  2. Cleaned the project using flutter clean and rebuilt it.

  3. Reinstalled Android Studio Hedgehog, ensuring the latest command line tools and platform tools are installed.

  4. Checked for JDK compatibility and environment variable settings.

What I was expecting:

I was expecting the app to be build without any errors.

Upvotes: 4

Views: 2201

Answers (1)

Safvan Husain
Safvan Husain

Reputation: 23

solution can be found from this comment

Upvotes: 0

Related Questions