Could not resolve all files for configuration ':stripe_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}.
GiuseppeSperanza opened this issue · 3 comments
GiuseppeSperanza commented
the problem only occurs with android, with iOS I can do the build correctly.
I cleared the cache of both gradle and the local project
after run flutter build appbundle, the build fails with this reason
What went wrong:
Execution failed for task ':stripe_android:compileReleaseJavaWithJavac'.
> Could not resolve all files for configuration ':stripe_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/giuseppesperanza/Library/Android/sdk/platforms/android-34/core-for-system-modules.jar.
> Error while executing process /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/jlink with arguments {--module-path /Users/giuseppesperanza/.gradle/caches/8.10/transforms/6bb3f6078521934c4acf3a7108f36720-a1e6a199-f470-41f1-89ed-caf9ea4688b3/transformed/output/temp/jmod --add-modules java.base --output /Users/giuseppesperanza/.gradle/caches/8.10/transforms/6bb3f6078521934c4acf3a7108f36720-a1e6a199-f470-41f1-89ed-caf9ea4688b3/transformed/output/jdkImage --disable-plugin system-modules}
Flutter Version: 3.24.3
Flutter Stripe Version: flutter_stripe: ^11.1.0
remonh87 commented
I need more info on this what is your android configuration etc? Did you follow https://github.com/flutter-stripe/flutter_stripe?tab=readme-ov-file#android?
GiuseppeSperanza commented
GiuseppeSperanza commented
After some debugging I found the issue... I had changed the gradle version and updated the correct jdk after defining the JAVA_HOME, in my case it was 17. However for some reason the project still took the default one from android studio. So I ran the following command flutter config --jdk-dir ‘PATH_TO_JDK_HOME’ in the project.
I restarted android studio and now it works!