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

Error(Android) in zendesk_messaging Package After Upgrading Flutter to 3.22 #54

Open
onurcevdetgungoren opened this issue May 20, 2024 · 2 comments

Comments

@onurcevdetgungoren
Copy link

After upgrading Flutter to version 3.22, I encountered an error in the zendesk_messaging package that prevents the Android build from succeeding. When I remove the zendesk_messaging package, the app runs without issues. However, including the package results in the following error message:

ERROR:/Users/xyz/.gradle/caches/transforms-3/574dd8af09e1230485910d9bc3ac16d6/transformed/jetified-zendesk-android-1.16.0-runtime.jar: D8: com.android.tools.r8.internal.Hc: Sealed classes are not supported as program classes
Here is the full error log:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeExtDexDevelopmentDebug'.
> Could not resolve all files for configuration ':app:developmentDebugRuntimeClasspath'.
   > Failed to transform messaging-android-2.16.0.aar (zendesk.messaging:messaging-android:2.16.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-30, org.gradle.category=library, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}.
      > Execution failed for DexingNoClasspathTransform: /Users/xyz/.gradle/caches/transforms-3/3ec7cfa80830986072404a2b6b4361a/transformed/jetified-messaging-android-2.16.0-runtime.jar.
         > Error while dexing.

Actual Behavior:
The build fails with a Sealed classes are not supported as program classes error when the zendesk_messaging package is included.

Flutter Version: Flutter 3.22

Gradle Version: 7.5

Additional Context:
Removing the zendesk_messaging package resolves the issue, but the functionality provided by the package is needed.
I suspect the issue might be related to compatibility between the zendesk_messaging package and the latest Flutter version.
Request for Help:
Could you provide guidance on resolving this issue? Is there a compatibility fix or workaround available for the zendesk_messaging package to work with Flutter 3.22? Any help would be greatly appreciated.

Thank you!

@lanzhu1993
Copy link

lanzhu1993 commented May 31, 2024

After upgrading Flutter to version 3.22, I encountered an error in the zendesk_messaging package that prevents the Android build from succeeding. When I remove the zendesk_messaging package, the app runs without issues. However, including the package results in the following error message:

ERROR:/Users/xyz/.gradle/caches/transforms-3/574dd8af09e1230485910d9bc3ac16d6/transformed/jetified-zendesk-android-1.16.0-runtime.jar: D8: com.android.tools.r8.internal.Hc: Sealed classes are not supported as program classes
Here is the full error log:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeExtDexDevelopmentDebug'.
> Could not resolve all files for configuration ':app:developmentDebugRuntimeClasspath'.
   > Failed to transform messaging-android-2.16.0.aar (zendesk.messaging:messaging-android:2.16.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-30, org.gradle.category=library, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=androidJvm}.
      > Execution failed for DexingNoClasspathTransform: /Users/xyz/.gradle/caches/transforms-3/3ec7cfa80830986072404a2b6b4361a/transformed/jetified-messaging-android-2.16.0-runtime.jar.
         > Error while dexing.

Actual Behavior: The build fails with a Sealed classes are not supported as program classes error when the zendesk_messaging package is included.

Flutter Version: Flutter 3.22

Gradle Version: 7.5

Additional Context: Removing the zendesk_messaging package resolves the issue, but the functionality provided by the package is needed. I suspect the issue might be related to compatibility between the zendesk_messaging package and the latest Flutter version. Request for Help: Could you provide guidance on resolving this issue? Is there a compatibility fix or workaround available for the zendesk_messaging package to work with Flutter 3.22? Any help would be greatly appreciated.

Thank you!

I updated Flutter version to 3.22 today and encountered the same issue. The solution is as follows: add r8 support in Android settings. gradle

my flutter version info:

Flutter 3.22.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision a14f74ff3a (9 days ago) • 2024-05-22 11:08:21 -0500
Engine • revision 55eae6864b
Tools • Dart 3.4.1 • DevTools 2.34.3

settrings.gradle info:
image

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
    buildscript {
        repositories {
            mavenCentral()
            maven {
                url = uri("https://storage.googleapis.com/r8-releases/raw")
            }
        }
        dependencies {
            classpath("com.android.tools:r8:8.2.26")
        }
    }
}

this issue links:
https://issuetracker.google.com/issues/227160052

@chyiiiiiiiiiiii
Copy link
Owner

Hi! Please try new version 2.9.1.

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