fluttercandies / flutter_image_compress

flutter image compress
MIT License
642 stars 217 forks source link

[How to use] It seems I can't use this library in the latest Android Studio Ladybug with Flutter 3.24.3 #318

Closed ythung1 closed 3 weeks ago

ythung1 commented 3 weeks ago

Platforms

dart, Android

Description

I want to try the plugin "flutter_image_compress" v2.3.0 in a new project that created in Android Studio Ladybug 2024.2.1 with Flutter 3.24.3, but whenever I want to run the project it will failed with this error:

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: D:\Android\Sdk\platforms\android-31\core-for-system-modules.jar.
         > Error while executing process D:\Android\Android Studio\jbr\bin\jlink.exe with arguments {--module-path D:\Android\.gradle\caches\transforms-3\8211d440d8dd690aaa34f139a8f1cd7b\transformed\output\temp\jmod --add-modules java.base --output D:\Android\.gradle\caches\transforms-3\8211d440d8dd690aaa34f139a8f1cd7b\transformed\output\jdkImage --disable-plugin system-modules}

Is there something wrong with my project setup or "flutter_image_compress" do not support the latest version of Flutter?

My code

No response

Try do it

No response

EvgenyAbdullaev commented 3 weeks ago

same

davidisraelgc commented 3 weeks ago

same error

ythung1 commented 3 weeks ago

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
}