flutter_image_compress icon indicating copy to clipboard operation
flutter_image_compress copied to clipboard

[Bug report] Execution failed for task ':flutter_image_compress_common:compileDebugJavaWithJavac'.

Open mshivkumar opened this issue 1 year ago • 6 comments

Version

2.3.0

Platforms

Android, iOS

Device Model

Moto Edge 40

flutter info

[✓] Flutter (Channel stable, 3.7.12, on macOS 14.6.1 23G93 darwin-arm64, locale
    en-IN)
    • Flutter version 3.7.12 on channel stable at /Users/mfho-27043771/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 4d9e56e694 (1 year, 6 months ago), 2023-04-17 21:47:46
      -0400
    • Engine revision 1a65d409c7
    • Dart version 2.19.6
    • DevTools version 2.20.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/mfho-27043771/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15E204a
    • CocoaPods version 1.15.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.3+-79915917-b509.11)

[✓] VS Code (version 1.93.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.98.0

[✓] Connected device (3 available)
    • motorola edge 40 (mobile) • ZD222CFBZ6 • android-arm64  • Android 14 (API 34)
    • macOS (desktop)           • macos      • darwin-arm64   • macOS 14.6.1 23G93 darwin-arm64
    • Chrome (web)              • chrome     • web-javascript • Google Chrome 129.0.6668.90

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

How to reproduce?

Include the package flutter_image_compress in your project, As this package internally depends on flutter_image_compress_common

Logs

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_image_compress_common:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':flutter_image_compress_common: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/mfho-27043771/Library/Android/sdk/platforms/android-31/core-for-system-modules.jar.
         > Error while executing process /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/jlink with arguments {--module-path /Users/mfho-27043771/.gradle/caches/transforms-3/26b10b86633c6cb11c4d8f8c1ba672d9/transformed/output/temp/jmod --add-modules java.base --output /Users/mfho-27043771/.gradle/caches/transforms-3/26b10b86633c6cb11c4d8f8c1ba672d9/transformed/output/jdkImage --disable-plugin system-modules}

Example code (optional)

No response

Contact

No response

mshivkumar avatar Oct 06 '24 07:10 mshivkumar

@mshivkumar I have a workaround for this till the official fix comes. I have added the project as local dependency and updated updated JAVA Version in build.gradle

mayurr1512 avatar Oct 06 '24 17:10 mayurr1512

you should take a look at this https://github.com/fluttercandies/flutter_image_compress/issues/318

ythung1 avatar Oct 08 '24 10:10 ythung1

@mshivkumar I have a workaround for this till the official fix comes. I have added the project as local dependency and updated updated JAVA Version in build.gradle

Can you please explain how did you changed JAVA version? I am facing the same issue now.

chandruyadav1995 avatar Oct 28 '24 07:10 chandruyadav1995

Same issue here. I don't understand anything about your workaround. Could you please detail a bit?

alexislg2 avatar Oct 29 '24 14:10 alexislg2

Because this issue is somewhat same as what I encounter, I will just copy paste my solution directly from issue #318, please try it out:

I think I found a way to solve this issue. It appears my issue has some relation with this issue.

The way to solve it is by upgrading gradle version from 8.1.0 to 8.2.2 that is located in the android/settings.gradle

plugins {
  id "com.android.application" version "8.2.2" apply false
}

ythung1 avatar Oct 29 '24 14:10 ythung1

It hasn't been solved with that. Did anyone find another solution?

angheSa avatar Nov 17 '24 16:11 angheSa