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]: Android build failures #2251

Closed
8 tasks done
vbuberen opened this issue Oct 11, 2023 · 4 comments · Fixed by #2252
Closed
8 tasks done

[Bug]: Android build failures #2251

vbuberen opened this issue Oct 11, 2023 · 4 comments · Fixed by #2252
Assignees
Labels
bug Something isn't working triage

Comments

@vbuberen
Copy link
Collaborator

vbuberen commented Oct 11, 2023

Platform

Android

Plugin

share_plus, device_info_plus

Version

8.0.0 for share_plus and 10.0.0 for device_info_plus

Flutter SDK

3.13.4

Steps to reproduce

Tried to just update plugins in one of projects I work on.
Project uses fresh dependencies and has Kotlin 1.8.20 and AGP 7.4.2, so it is not an issue with some old Android native dependencies.

flutter clean didn't help.

Tried to find something similar and found that mobile_scanner also has a similar issue juliansteenbakker/mobile_scanner#729 and it is also related to Kotlin 1.9.x

Not sure about the solution, but I also found this page where it is stated that for Kotlin 1.9 project needs to have AGP 8.0.

Based on this fact I am thinking about retracting latest versions of plugins that have Kotlin 1.9.10 and would like to revert Kotlin to older version to not have such unexpected failures that can't be reproduced by building available example apps.

Code Sample

No response

Logs

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 kotlin-stdlib-1.9.10.jar (org.jetbrains.kotlin:kotlin-stdlib:1.9.10) 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.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: /Users/vb/.gradle/caches/transforms-3/28d185a8757e9cd8ecae045e483e8213/transformed/jetified-kotlin-stdlib-1.9.10.jar.
         > Error while dexing.

Flutter Doctor

[✓] Flutter (Channel stable, 3.13.4, on macOS 13.5.2 22G91 darwin-arm64, locale en-UA)
    • Flutter version 3.13.4 on channel stable at /Users/vb/fvm/versions/3.13.4
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 367f9ea16b (4 weeks ago), 2023-09-12 23:27:53 -0500
    • Engine revision 9064459a8b
    • Dart version 3.1.2
    • DevTools version 2.25.0

[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/vb/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode-15.0.0.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.13.0

[✓] IntelliJ IDEA Ultimate Edition (version 2023.2.2)
    • IntelliJ at /Users/vb/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin version 75.1.4
    • Dart plugin version 232.9559.10

Checklist before submitting a bug

  • I searched issues in this repository and couldn't find such bug/problem
  • I Google'd a solution and I couldn't find it
  • I searched on StackOverflow for a solution and I couldn't find it
  • I read the README.md file of the plugin
  • I'm using the latest version of the plugin
  • All dependencies are up to date with flutter pub upgrade
  • I did a flutter clean
  • I tried running the example project
@vbuberen vbuberen added bug Something isn't working triage labels Oct 11, 2023
@vbuberen
Copy link
Collaborator Author

@nohli FYI

@nohli
Copy link
Member

nohli commented Oct 11, 2023

Have you tried the changes I had to make in this PR?
#2134

Idk what's better - reproduce the fix, and write it in a migration guide, including a breaking change, or just downgrade to kotlin 1.8.20.

Either way, retracting the latest versions would make sense.

@vbuberen
Copy link
Collaborator Author

Have you tried the changes I had to make in this PR?
#2134

You mean to try them in that project with problem? It is already using everything latest, including targeting Java 17 for a few months already. These changes have nothing to do with R8 error (as from logs the error is pointing at R8).

I have already retracted versions, will open a PR with rollback of Kotlin updates and will release updates tomorrow with rollback as some plugins had other changes which are useful to users of plugins.

But I really hate what Google and Jetbrains did in their latest Kotlin and AGP releases - too many problems. Earlier it was much safer to update.

@milindgoel15
Copy link

downgrading kotlin to 1.8.10 would have been enough imo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants