Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug report] Could not resolve all files for configuration ':flutter_image_compress_common:classpath' #319

Open
spencerchubb opened this issue Oct 4, 2024 · 4 comments

Comments

@spencerchubb
Copy link

Version

2.3.0

Platforms

Android

Device Model

Android emulator, VanillaIceCream

flutter info

[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22631.4169], locale en-US)
    • Flutter version 3.24.3 on channel stable at C:\Users\spencerchubb\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (3 weeks ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at C:\Users\spencerchubb\AppData\Local\Android\Sdk
    • Platform android-35, build-tools 35.0.0
    • ANDROID_HOME = C:\Users\spencerchubb\AppData\Local\Android\Sdk
    • ANDROID_SDK_ROOT = C:\Users\spencerchubb\AppData\Local\Android\Sdk
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
    • Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft.com/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components

[√] Android Studio (version 2024.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • 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+-12282718-b509.11)

[√] VS Code (version 1.93.1)

[√] Connected device (4 available)

[√] Network resources
    • All expected network resources are available.

How to reproduce?

Create brand new flutter app, add flutter_image_compress under dependencies, and run flutter run

Logs

Launching lib\main.dart on sdk gphone64 x86 64 in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':flutter_image_compress_common'.
> Could not resolve all files for configuration ':flutter_image_compress_common:classpath'.
   > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20.
     Required by:
         project :flutter_image_compress_common
      > Could not resolve org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20.
         > Could not parse POM https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-gradle-plugin/1.8.20/kotlin-gradle-plugin-1.8.20.pom
            > Resetting to invalid mark
> Failed to notify project evaluation listener.
   > Could not get unknown property 'android' for project ':flutter_image_compress_common' of type org.gradle.api.Project.
   > Could not get unknown property 'android' for project ':flutter_image_compress_common' of type org.gradle.api.Project.

Example code (optional)

No response

Contact

No response

@spencerchubb
Copy link
Author

found a hacky workaround that involves directly modifying the installed package

I opened the file flutter_image_compress_common-1.0.5\android\build.gradle

then I changed ext.kotlin_version to something more recent such as 2.0.20

@catekhui
Copy link

catekhui commented Oct 6, 2024

I have been facing a similar issue with flutter_image_compress_common: I have spent three days trying all manner of solutions from the internet, and nothing works for me. I have even edited the settings.grandle and changed the Kotln version to 1.9.0, but still doesn't work. Well, the latest version of Kotlin 2.0.20 caused huge issues with other plugins.

My error log:


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: C:\Users\USER\AppData\Local\Android\sdk\platforms\android-31\core-for-system-modules.jar.
         > The provided zip (C:\Users\USER\AppData\Local\Android\sdk\platforms\android-31\core-for-system-modules.jar) is invalid. Entry 'META-INF/' name field is 35976 bytes in the Central Directory but 9 in the Local File Header

* 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 5m 7s

Error: Gradle task assembleDebug failed with exit code 1

@bxrhhy
Copy link

bxrhhy commented Oct 23, 2024

我也是同样的问题,flutter版本3.24.3,flutter_image_compress版本2.3.0,折腾半天了,

Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':flutter_image_compress_common' of type org.gradle.api.Project.
Could not get unknown property 'android' for project ':flutter_image_compress_common' of type org.gradle.api.Project.

@CaiJingLong
Copy link
Member

CaiJingLong commented Oct 23, 2024

Hi, I can't get the error in new project.
I use flutter 3.24.3 to run the command:

flutter create example_3_24
cd example_3_24 
flutter pub add flutter_image_compress
flutter pub get
flutter build apk --debug
image

So, you edit other config?
Such as: gradle_wrapper version, jdk version, android build_tools version, kotlin version.

If you can, please create a github repo for your project, and remove gradle_wrapper config from .gitignore file, I'll clone it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants