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

Upgrader not working after just installing the package #475

Open
Gonzalo-Bruna opened this issue Nov 29, 2024 · 2 comments
Open

Upgrader not working after just installing the package #475

Gonzalo-Bruna opened this issue Nov 29, 2024 · 2 comments
Labels
Android How To? This is a how to question

Comments

@Gonzalo-Bruna
Copy link

I just installed the package, and without doing anything at all, the app already breaks. These are the logs from the debug console:


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: C:\Users\gonza\.gradle\caches\transforms-3\bce7cff575fb6b98d86458127cdb5512\transformed\jetified-annotation-jvm-1.9.1.jar.
         > Error while dexing.
   > Failed to transform kotlin-stdlib-2.1.0.jar (org.jetbrains.kotlin:kotlin-stdlib:2.1.0) 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: C:\Users\gonza\.gradle\caches\transforms-3\3dacbcbabde2f8dc3e69ec3c17f9a9c1\transformed\jetified-kotlin-stdlib-2.1.0.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 51s

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

And this is the upgrader version used:

  upgrader:
    dependency: "direct main"
    description:
      name: upgrader
      sha256: "9b907a8c956dbf3f2d0430d16134e27543cba98eab31f19a2240ab1c4d920506"
      url: "https://pub.dev"
    source: hosted
    version: "11.3.0"

By the way I currently have Kotlin 1.7.10 installed, but I’ve tried using other versions without success. I tested the latest version before 2.0 (1.9.25) and also tried Kotlin 2.0.20, but neither worked.
Any solution or ideas of why this could be happening? Thanks in advance

@larryaasen
Copy link
Owner

@Gonzalo-Bruna The upgrader package itself does not use any Android native code. It only depends on packages that use native code. You should check all of your dependencies to see which ones require Android Gradle updates.

@larryaasen larryaasen added How To? This is a how to question Android labels Nov 30, 2024
@Gonzalo-Bruna
Copy link
Author

@larryaasen Thank you for your response. However, I want to clarify a few points:

  1. The error occurs immediately after adding the upgrader package to a previously working project. I literally only:

    • Added the package to pubspec.yaml
    • Ran flutter pub get
    • Tried to run the app
  2. The app was working perfectly fine before adding upgrader, and the error appears immediately after adding it, without any other changes to the project or its dependencies.

  3. The error seems specifically related to Kotlin version conflicts, showing:

    • Issues with annotation-jvm-1.9.1.jar
    • Issues with kotlin-stdlib-2.1.0.jar

Given this sequence of events, it seems the upgrader package might be introducing some indirect dependency that's causing conflicts with Kotlin versions. Could you help me understand:

  1. What specific Android Gradle or Kotlin version requirements the upgrader package or its dependencies might have?
  2. Are there any known compatibility issues with specific Kotlin versions?

This would help me better understand how to resolve the issue, since the problem appears to be directly related to adding the upgrader package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android How To? This is a how to question
Projects
None yet
Development

No branches or pull requests

2 participants