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

Android build failed [Execution failed for task ':app:mergeLibDexDebug] #339

Closed
RoyalCoder88 opened this issue Jun 4, 2024 · 6 comments
Closed

Comments

@RoyalCoder88
Copy link

Flutter doctor -v
[√] Flutter (Channel stable, 3.22.1, on Microsoft Windows [Version 10.0.22631.3593], locale en-GB)
• Flutter version 3.22.1 on channel stable at C:\tools\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a14f74ff3a (13 days ago), 2024-05-22 11:08:21 -0500
• Engine revision 55eae6864b
• Dart version 3.4.1
• DevTools version 2.34.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:\Users\burac\AppData\Local\Android\sdk
• Platform android-UpsideDownCakePrivacySandbox, build-tools 34.0.0
• Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
• 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.4.4)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.4.33213.308
• Windows 10 SDK version 10.0.22000.0

[√] Android Studio (version 2023.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 17.0.9+0--11185874)

[√] VS Code (version 1.89.1)
• VS Code at C:\Users\burac\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.90.0

[√] Connected device (4 available)
• SM A908B (mobile) • RFCMA02W5WT • android-arm64 • Android 12 (API 31)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.22631.3593]
• Chrome (web) • chrome • web-javascript • Google Chrome 125.0.6422.114
• Edge (web) • edge • web-javascript • Microsoft Edge 125.0.2535.51

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

• No issues found!

Package version
record 5.1.1

Environment

  • OS: Android

Describe the bug

`Launching lib\main.dart on SM A908B in debug mode...
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
ERROR:C:\Users\burac\Desktop\Apps\projects\vlarch\archie\build\record_android\intermediates\runtime_library_classes_dir\debug\com\llfbandit\record\record\format\Format.class: D8: com.android.tools.r8.internal.Hc: Sealed classes are not supported as program classes

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeLibDexDebug'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
Failed to transform debug (project :record_android) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, com.android.build.api.attributes.AgpVersionAttr=7.3.0, com.android.build.api.attributes.BuildTypeAttr=debug, com.android.build.gradle.internal.attributes.VariantAttr=debug, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=31, org.gradle.category=library, org.gradle.jvm.environment=android, org.gradle.libraryelements=classes, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}.
> Execution failed for DexingNoClasspathTransform: C:\Users\burac\Desktop\Apps\projects\vlarch\archie\build\record_android\intermediates\runtime_library_classes_dir\debug.
> 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 1m 36s

┌─ 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

Exited (1).
`

@llfbandit
Copy link
Owner

Duplicate #333

@sambitraze
Copy link

were you able to fix it @RoyalCoder88

@sambitraze
Copy link

Duplicate #333

the solution mentioned here is not working for the latest Flutter update.

[✓] Flutter (Channel stable, 3.22.1, on Microsoft Windows [Version 10.0.22631.3593], locale en-IN)
• Flutter version 3.22.1 on channel stable at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision a14f74ff3a (2 weeks ago), 2024-05-22 11:08:21 -0500
• Engine revision 55eae6864b
• Dart version 3.4.1
• DevTools version 2.34.3

@RoyalCoder88
Copy link
Author

@sambitraze

Yes I did, I updated the android/settings.gradle, like this:

plugins {
    id "dev.flutter.flutter-plugin-loader" version "1.0.0"
    id "com.android.application" version "7.4.1" apply false
}

That fix the issue for me, hope will be fine for you as well!

@sambitraze
Copy link

yes i solved it but a bit different way

@llfbandit
Copy link
Owner

Instructions are available here: https://github.com/llfbandit/record/blob/master/record_android/README.md

@llfbandit llfbandit closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2024
Repository owner locked as resolved and limited conversation to collaborators Jun 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants