urbanairship / android-library

Urban Airship Android SDK
Other
109 stars 123 forks source link

Fatal Exception: java.lang.NoSuchMethodError: No direct method <init>(Lkotlin/sequences/Sequence;)V in class Lkotlin/sequences/ConstrainedOnceSequence #233

Closed wezley98 closed 2 months ago

wezley98 commented 10 months ago

Preliminary Info

What Airship dependencies are you using?

airship-fcm = { module = "com.urbanairship.android:urbanairship-fcm", version = "17.4.0" }

What are the versions of any relevant development tools you are using?

android-compilesdk = "34"
android-minsdk = "26"
android-targetsdk = "33"

android = "8.1.2"
kotlin = "1.9.10"

firebase-bom = { module = "com.google.firebase:firebase-bom", version = "32.3.1" }
firebase-messaging = { module = "com.google.firebase:firebase-messaging" }

Report

What unexpected behavior are you seeing?

Crash reported in Firebase Android 8.1 Device Galaxy Tab A (2016)

Will update issue if more devices reported.

Fatal Exception: java.lang.NoSuchMethodError: No direct method <init>(Lkotlin/sequences/Sequence;)V in class Lkotlin/sequences/ConstrainedOnceSequence; or its super classes (declaration of 'kotlin.sequences.ConstrainedOnceSequence' appears in /data/app/it.sky.skysport-9I0PVUc5bNP2RW69HEKO1A==/base.apk!classes6.dex)
       at kotlin.sequences.SequencesKt__SequencesKt.constrainOnce(Sequences.kt:626)
       at kotlin.sequences.SequencesKt__SequencesKt.asSequence(Sequences.kt:30)
       at kotlinx.coroutines.internal.MainDispatcherLoader.loadMainDispatcher(MainDispatchers.kt:35)
       at kotlinx.coroutines.internal.MainDispatcherLoader.<clinit>(MainDispatchers.kt:22)
       at kotlinx.coroutines.Dispatchers.getMain(Dispatchers.kt)
       at com.urbanairship.push.PushNotificationStatusObserver.<init>(PushNotificationStatusObserver.kt:16)
       at com.urbanairship.push.PushNotificationStatusObserver.<init>(PushNotificationStatusObserver.kt:1)
       at com.urbanairship.push.PushManager.<init>(PushManager.java:309)
       at com.urbanairship.push.PushManager.<init>(PushManager.java:274)
       at com.urbanairship.UAirship.init(UAirship.java:745)
       at com.urbanairship.UAirship.executeTakeOff(UAirship.java:427)
       at com.urbanairship.UAirship.access$000(UAirship.java)
       at com.urbanairship.UAirship$2.run(UAirship.java:386)
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
       at com.urbanairship.util.AirshipThreadFactory$1.run(AirshipThreadFactory.java:50)
       at java.lang.Thread.run(Thread.java:764)

What is the expected behavior?

No crash is reported

What are the steps to reproduce the unexpected behavior?

Only reported in Firebase, can't reproduce locally atm.

Do you have logging for the issue?

See stracktrace above.

rlepinski commented 2 months ago

@wezley98 Sorry we most of missed this before, did you get it resolved?

wezley98 commented 2 months ago

Kind of, we have a workaround in place

 configurations.all {
        resolutionStrategy {
            force("org.jetbrains.kotlinx:kotlinx-coroutines-core:" + rootProject.libs.versions.coroutines.get())
            force("org.jetbrains.kotlinx:kotlinx-coroutines-android:" + rootProject.libs.versions.coroutines.get())
            force("org.jetbrains.kotlinx:kotlinx-coroutines-test:" + rootProject.libs.versions.coroutines.get())
        }
    }

It's more likely a dependency/kotlin issue rather than an airship issue. Going to close for now.