[Compile]: FAILED TO RUN AFTER UPDATING TO ANDROID STUDIO LADY BUG *** CRITICAL
Operating System
Windows 11
Plugin
connectivity_plus
Version
6.0.5
Flutter SDK
Flutter 3.24.3 • channel stable • https://github.com/flutter/flutter.git Framework • revision 2663184aa7 (3 weeks ago) • 2024-09-11 16:27:48 -0500 Engine • revision 36335019a8 Tools • Dart 3.5.3 • DevTools 2.37.3
Compilation command
running the project normally in Android Studio: flutter run flutter debug
Dart Dependencies
No response
Native dependencies
No response
Compilation Error
* What went wrong:
Execution failed for task ':connectivity_plus:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':connectivity_plus: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:\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\ASUS\.gradle\caches\transforms-4\27d4116a6b8bfadbced0f80b87c44b18-3637e9fd-df62-40a9-93a2-142d7473c4e3\transformed\output\temp\jmod --add-modules java.base --output C:\Users\ASUS\.gradle\caches\transforms-4\27d4116a6b8bfadbced0f80b87c44b18-3637e9fd-df62-40a9-93a2-142d7473c4e3\transformed\output\jdkImage --disable-plugin system-modules}
Flutter Doctor
[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Version 10.0.22631.4249], locale en-US)
• Flutter version 3.24.3 on channel stable at D:\SDK\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 D:\SDK
• Platform android-35, build-tools 35.0.0
• 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
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.11.3)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.11.35303.130
• Windows 10 SDK version 10.0.22621.0
[√] 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)
[√] Connected device (4 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 15 (API 35) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.4249]
• Chrome (web) • chrome • web-javascript • Google Chrome 129.0.6668.90
• Edge (web) • edge • web-javascript • Microsoft Edge 129.0.2792.65
[√] Network resources
• All expected network resources are available.
• No issues found!
Process finished with exit code 0
Checklist before submitting a bug
- [X] I searched issues in this repository and couldn't find such bug/problem
- [X] I Google'd a solution and I couldn't find it
- [X] I searched on StackOverflow for a solution and I couldn't find it
- [X] I read the README.md file of the plugin
- [X] I'm using the latest version of the plugin
- [X] All dependencies are up to date with
flutter pub upgrade - [X] I did a
flutter clean - [X] I tried running the example project
same issue
same issue @AmrTawfek try this version in settings.gradle. Seems to sort out the issue for now:
id "com.android.application" version "8.3.2" apply false
same issue @AmrTawfek try this version in settings.gradle. Seems to sort out the issue for now:
id "com.android.application" version "8.3.2" apply false
thanks @mehrdad1990 , I will try it because when I countered this issue I downgraded my IDE version to latest working one
what is the Gradle version you use please in distributionUrl? @mehrdad1990
Getting same issue on MacOS.
Downgrading the AndroidStudio did not fix the issue
* What went wrong:
Execution failed for task ':device_info_plus:compileReleaseJavaWithJavac'.
> Could not resolve all files for configuration ':device_info_plus: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/daksh-gargas/dev/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/daksh-gargas/.gradle/caches/transforms-3/e8dfe22a750ee0e24ac6b098f580808c/transformed/output/temp/jmod --add-modules java.base --output /Users/daksh-gargas/.gradle/caches/transforms-3/e8dfe22a750ee0e24ac6b098f580808c/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.
* What went wrong:
Execution failed for task ':connectivity_plus:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':connectivity_plus:androidJdkImage'.
Same problem, but I resolved it with updating AGP version (from 7.3.0):
id "com.android.application" version "8.3.0" apply false
Unfortunately updating to a newer AGP requires some additional tweaks.
what is the Gradle version you use please in distributionUrl? @mehrdad1990
@adham-ashraf77 this is the version : gradle-8.6-all
same for me. I am unable to use workaround with updating AGP version because it affects other packages :(
same for me. I am unable to use workaround with updating AGP version because it affects other packages :(
We have a huge app that use a lot of dependencies, I migrated AGP and all affected packages, I had to fork some myself unfortunately. But know it works.
same for me. I am unable to use workaround with updating AGP version because it affects other packages :(
We have a huge app that use a lot of dependencies, I migrated AGP and all affected packages, I had to fork some myself unfortunately. But know it works.
Yep, that's the way, but I don't want to fork other packages if there's a chance of a possible fix
seems working with latest
id "com.android.application" version "8.7.0" apply false
the same issue, all tricks failed
This worked for me:
id "com.android.application" version "8.7.0" apply false
same issue
Could not resolve all files for configuration ':connectivity_plus: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/algooceansmacbook/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/algooceansmacbook/.gradle/caches/transforms-3/b7ad379871a160c29269eed9ca2ef736/transformed/output/temp/jmod --add-modules java.base --output /Users/algooceansmacbook/.gradle/caches/transforms-3/b7ad379871a160c29269eed9ca2ef736/transformed/output/jdkImage --disable-plugin system-modules}
same issue
Fixed issue by using:
id "com.android.application" version "8.7.0" apply false
in plugins block In android/settings.gradle
Also set in gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
Currently using Java version:
java version "1.8.0_301"
Fixed issue by using:
id "com.android.application" version "8.7.0" apply falsein plugins block In android/settings.gradle
yes this work for me additionally need to set distributionUrl=https://services.gradle.org/distributions/gradle-8.9-all.zip
Which Java/JDK-Version are you using in your projects for those solutions?
Thanks to everyone for helping each other fix the compilation issue. I am marking this issue as completed, but I pinned it so it is easier to find.
Please do as said by malwinder-s:
Fixed issue by using:
id "com.android.application" version "8.7.0" apply falsein plugins block In android/settings.gradleAlso set in gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
Please do as said by malwinder-s:
Fixed issue by using:
id "com.android.application" version "8.7.0" apply falsein plugins block In android/settings.gradle Also set in gradle-wrapper.properties:distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
When doing so, I get the error:
Your project is configured with Android NDK 23.1.7779620, but the following plugin(s) depend on a different Android NDK version:
- connectivity_plus requires Android NDK 27.0.12077973
- ....
My android parameters inside my build.gradle look like this:
android {
namespace "my_app"
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '17'
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId "my_app"
minSdkVersion 23
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}
I use Android Studio Ladybug 2024.2.1. Before, with Koala and lower Gradle-version, everything worked fine.