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] Can't run project in flutter 3.19.0 #231

Open
kkday-kevinhorasia opened this issue May 3, 2024 · 7 comments
Open

[Android] Can't run project in flutter 3.19.0 #231

kkday-kevinhorasia opened this issue May 3, 2024 · 7 comments
Assignees

Comments

@kkday-kevinhorasia
Copy link

Issue Summary

Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
Building with Flutter multidex support enabled.
ERROR:~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.jar: D8: java.lang.NullPointerException

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 core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) 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=26, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: ~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.jar.
         > Error while dexing.
   > Failed to transform core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) 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=26, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: ~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.jar.
         > Error while dexing.
   > Failed to transform core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) 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=26, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: ~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.jar.
         > Error while dexing.
   > Failed to transform core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) 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=26, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: ~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.jar.
         > Error while dexing.
   > Failed to transform core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) 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=26, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: ~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.jar.
         > Error while dexing.
   > Failed to transform core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) 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=26, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: ~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.jar.
         > Error while dexing.
   > Failed to transform core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) 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=26, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: ~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.jar.
         > Error while dexing.
   > Failed to transform core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) 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=26, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: ~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.jar.
         > Error while dexing.
   > Failed to transform core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) 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=26, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: ~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.jar.
         > Error while dexing.
   > Failed to transform core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) 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=26, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: ~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.jar.
         > Error while dexing.
   > Failed to transform core-1.14.0-alpha01.aar (androidx.core:core:1.14.0-alpha01) 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=26, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingNoClasspathTransform: ~/.gradle/caches/transforms-3/00d9d634312ff5516499237d011ad1ac/transformed/core-1.14.0-alpha01-runtime.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 6s
Error: Gradle task assembleDebug failed with exit code 1


Exited (1).

Steps to Reproduce

  1. flutter pub add twilio_voice
  2. flutter run lib/main.dart

This error occur only after adding this twilio_voice package to my dependency, if I remove it then I can run the project normally.
I think this happen because of this Breaking Changes.

Hopefully you can update this package and solve this problem.
Thank you

@kkday-kevinhorasia
Copy link
Author

kkday-kevinhorasia commented May 3, 2024

I solve the problem by changing implementation 'androidx.core:core-ktx:+' in twilio_voice/android/build.gradle file as below:

dependencies {
    implementation(platform("org.jetbrains.kotlin:kotlin-bom:$kotlin_version"))
    implementation(platform("com.google.firebase:firebase-bom:32.2.2"))
    implementation("com.twilio:voice-android:6.3.2")
    implementation("com.google.firebase:firebase-messaging-ktx:23.2.1")
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.lifecycle:lifecycle-process:2.6.1'
    implementation 'androidx.core:core-ktx:1.13.1'
    runtimeOnly("androidx.lifecycle:lifecycle-extensions:2.2.0")
    runtimeOnly("androidx.constraintlayout:constraintlayout:2.1.4")
}

But, I am afraid this approach may affect some functionality in this package

Another solution is to add this in your flutter project android/app/build.gradle file:

configurations.all {
    resolutionStrategy { force 'androidx.core:core-ktx:1.13.1' }
}

@yazanturk
Copy link

@kkday-kevinhorasia project is running, but the first run crashed and happened exception when requesting permission from Twilio

@kkday-kevinhorasia
Copy link
Author

Hi @yazanturk,

About requesting permission from Twilio, in my case it only work for the first time we installed and open the app.
When we close app, clear app, open it again and request the same permission again it will not request it again.

I don't know why this happened, maybe you can open a new issue regarding this problem.
And if you find the solution to the problem please let me know too :)

@cybex-dev
Copy link
Owner

Thank you for reporting the issue, I'll investigate this issue later the week.

@yazanturk
Copy link

@cybex-dev Thanks

@yazanturk
Copy link

Hi @yazanturk,

About requesting permission from Twilio, in my case it only work for the first time we installed and open the app. When we close app, clear app, open it again and request the same permission again it will not request it again.

I don't know why this happened, maybe you can open a new issue regarding this problem. And if you find the solution to the problem please let me know too :)

the problem is solved check the package please ?

@kkday-kevinhorasia
Copy link
Author

kkday-kevinhorasia commented May 23, 2024

Hi @yazanturk,
About requesting permission from Twilio, in my case it only work for the first time we installed and open the app. When we close app, clear app, open it again and request the same permission again it will not request it again.
I don't know why this happened, maybe you can open a new issue regarding this problem. And if you find the solution to the problem please let me know too :)

the problem is solved check the package please ?

I think it is not a problem according to this docs. It is actually android permissions default behavior (One-time permissions).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants