ERROR:D8: com.android.tools.r8.kotlin.H
Steps to reproduce
I tried to run it on my phone I got this mistake
Actual results
ERROR:D8: com.android.tools.r8.kotlin.H
ERROR:D8: com.android.tools.r8.kotlin.H
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Failed to transform annotation-jvm-1.9.1.jar (androidx.annotation:annotation-jvm:1.9.1) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.jvm.environment=standard-jvm, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
> Execution failed for DexingWithClasspathTransform: F:\android_pakage\.gradle\caches\transforms-3\dc15d5748b3cc5a97f933fb3f6f7ac0e\transformed\jetified-annotation-jvm-1.9.1.jar.
> Error while dexing.
> Failed to transform kotlin-stdlib-1.9.24.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.24) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=21, org.gradle.category=library, org.gradle.jvm.environment=standard-jvm, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
> Execution failed for DexingWithClasspathTransform: F:\android_pakage\.gradle\caches\transforms-3\db50bfc3f8c6e77b6d677c566d5fb878\transformed\jetified-kotlin-stdlib-1.9.24.jar.
> Error while dexing.
* 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 26s
┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode. │
│ To disable the shrinker, pass the `--no-shrink` flag to this command. │
│ To learn more, see: https://developer.android.com/studio/build/shrink-code │
└────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
Logs
[!] Flutter (Channel stable, 3.24.3, on Microsoft Windows [版本 10.0.19045.4291], locale zh-CN)
• Flutter version 3.24.3 on channel stable at C:\Users\Administrator\fvm\default
! Warning: `flutter` on your path resolves to C:\Users\Administrator\fvm\versions\3.24.3\bin\flutter, which is not inside your current Flutter SDK checkout at C:\Users\Administrator\fvm\default. Consider adding
C:\Users\Administrator\fvm\default\bin to the front of your path.
! Warning: `dart` on your path resolves to C:\Users\Administrator\fvm\versions\3.24.3\bin\dart, which is not inside your current Flutter SDK checkout at C:\Users\Administrator\fvm\default. Consider adding
C:\Users\Administrator\fvm\default\bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2663184aa7 (3 months ago), 2024-09-11 16:27:48 -0500
• Engine revision 36335019a8
• Dart version 3.5.3
• DevTools version 2.37.3
• Pub download mirror https://pub.flutter-io.cn
• Flutter download mirror https://storage.flutter-io.cn
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[√] 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 F:\android_pakage\SDK
• Platform android-34, build-tools 34.0.0
• ANDROID_HOME = F:\android_pakage\SDK
• Java binary at: E:\javasdk\jdk-17.0.10\bin\java
• Java version Java(TM) SE Runtime Environment (build 17.0.10+11-LTS-240)
• 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.10.1)
• Visual Studio at E:\Visualstudio\install
• Visual Studio Community 2022 version 17.10.34928.147
• Windows 10 SDK version 10.0.22621.0
[√] Android Studio (version 2024.2)
• Android Studio at E:\jetbrains-toolbox-2.2.1.19765\install\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)
• 22011211C (mobile) • EEMBLZHQ698TTG4D • android-arm64 • Android 14 (API 34)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [版本 10.0.19045.4291]
• Chrome (web) • chrome • web-javascript • Google Chrome 131.0.6778.86
• Edge (web) • edge • web-javascript • Microsoft Edge 92.0.902.67
[√] Network resources
• All expected network resources are available.
@liangchuying
It may be occuring due to incompatibility. Did you add any plugin recently after which it started occuring ?
I accidentally had this error after I added interactive_media_ads plugin. After removing it, the error didn't occur, so check if any of the plugin's kotlin version or gradle version compatibility is triggering the error or not.
Another way could be caching. See https://github.com/flutter/flutter/issues/146038#issuecomment-2035504109
I have confirmed that I have not installed any new plugins recently, but I have updated Android Studio and Flutter SDK. I am trying to update Gradle and Kotlin.
I have the same issue, but in my case, the issue happens after I installed the upgrader package. I tried upgrading Kotlin but it didn't fix the issue.
If that's the case, should I open an issue on the package repository?
My problem was that the version of url_launcher_android 6.3.13 conflicted with my project.
@liangchuying
url_launcher_android 6.3.13 conflicted with my project.
Are you explicitly using this plugin in your project ? It is endorsed, so just using url_launcher should suffice. Does the error occur after you added this plugin and removing it also doesn't cause the error anymore ?
Is there a way to replicate this consistently with just this plugin and barebone code and conflicting package ?
having same issue possible duplicate to this minSdk set to 24
We had the same issue. We solved it by setting minifyEnabled to true in our android/app/build.gradle:
android {
buildTypes {
release {
minifyEnabled true
}
profile {
minifyEnabled true
}
debug {
minifyEnabled true
}
}
}
We had the same issue. We solved it by setting
minifyEnabledtotruein ourandroid/app/build.gradle:android { buildTypes { release { minifyEnabled true } profile { minifyEnabled true } debug { minifyEnabled true } } }
This helps, but i think we need to know what was causing this problem, in my case from last build i did not add any dependencies.
Try to go back to the available project branch and try it
@liangchuying Is this resolved at your end and can it be closed ?
yes, Thank you. Excuse me
Closing as resolved based on above comment.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.