I recently updated Android Studio to Ladybug and since then I encounter this error when i try to build my app:
Launching libmain.dart on sdk gphone64 x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':path_provider_android:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':path_provider_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: C:UsersilsimAppDataLocalAndroidSdkplatformsandroid-34core-for-system-modules.jar.
> Error while executing process C:Program FilesAndroidAndroid Studiojbrbinjlink.exe with arguments {--module-path C:Usersilsim.gradlecachestransforms-34a46fc89ed5f9adfe3afebf74eb8bfebtransformedoutputtempjmod --add-modules java.base --output C:Usersilsim.gradlecachestransforms-34a46fc89ed5f9adfe3afebf74eb8bfebtransformedoutputjdkImage --disable-plugin system-modules}
What I checked is:
flutter doctor:
[√] Flutter (Channel stable, 3.24.3, on Microsoft Windows [Versione 10.0.22631.4249], locale it-IT)
• Flutter version 3.24.3 on channel stable at C:UsersilsimDocumentsflutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (4 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 34.0.0)
• Android SDK at C:UsersilsimAppDataLocalAndroidsdk
• Platform android-34, build-tools 34.0.0
• Java binary at: C:Program FilesAndroidAndroid Studiojbrbinjava
• Java version OpenJDK Runtime Environment (build 21.0.3+-12282718-b509.11)
• All Android licenses accepted.
[X] Chrome - develop for the web (Cannot find Chrome executable at .GoogleChromeApplicationchrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[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 FilesAndroidAndroid 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 (3 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 15 (API 35) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Versione 10.0.22631.4249]
• Edge (web) • edge • web-javascript • Microsoft Edge 129.0.2792.79
[√] Network resources
• All expected network resources are available.
! Doctor found issues in 2 categories.
I’ve never touched the Gradle configuration files and the code but before the update everything worked fine, also I do not use the package path_provider in my app. So can someone help me solve the problem?
2
Answers
Step 1: Flutter clean
Step 2: Flutter pub cache repair
Step 3: Invalidate cache and restart(select the clear VCS Log caches and indexes, delete embedded browser engine cache and coockies)
Step 4: Flutter pub get
Solution for Android Studio LadyBug Upgrade Issues
If you’ve encountered issues after upgrading to Android Studio LadyBug, here’s how you can resolve them:
Modify
settings.gradle
File:settings.gradle
file, add the following line:Gradle Plugin Error:
gradle-wrapper.properties
file with the following:After making these changes, clean and rebuild your project to ensure everything compiles correctly.