braze-inc / braze-android-sdk

https://www.braze.com
Other
20 stars 8 forks source link

[Bug]: Child job of SerialCoroutineScope got exception on 31.1.0 #34

Open sujin-kk opened 1 month ago

sujin-kk commented 1 month ago

Braze Android SDK Version

31.1.0 (import braze-ui only)

Steps To Reproduce

  1. MyApplication.kt
    @HiltAndroidApp
    class MyApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        val brazeConfig: BrazeConfig = BrazeConfig.Builder()
            .setApiKey("MY_API_KEY")
            .setIsFirebaseCloudMessagingRegistrationEnabled(false)
            .setAdmMessagingRegistrationEnabled(false)
            .setSessionTimeout(11)
            .setHandlePushDeepLinksAutomatically(true)
            .setTriggerActionMinimumTimeIntervalSeconds(5)
            .setIsLocationCollectionEnabled(false)
            .setNewsfeedVisualIndicatorOn(true)
            .setBadNetworkDataFlushInterval(120)
            .setGoodNetworkDataFlushInterval(60)
            .setGreatNetworkDataFlushInterval(10)
            .build()
        Braze.configure(this, brazeConfig)
        registerActivityLifecycleCallbacks(BrazeActivityLifecycleCallbackListener())
    }
    }

after initialize, Child job of SerialCoroutineScope got exception occured. But, in version 26+, this error did not occur and all APIs including event tracking and in-app messages worked.

Expected Behavior

All Braze APIs are integrated. as 26.+ version.

Actual Incorrect Behavior

occured Child job of SerialCoroutineScope got exception an Not connected to all Braze APIs. Try linking Braze (31.1.0) with Google’s representative app, NowInAndroid.

Verbose Logs

Braze v31.1.0 .n80      Child job of SerialCoroutineScope got exception: java.lang.VerifyError: Verifier rejected class com.braze.BrazeUser: boolean com.braze.BrazeUser.setCountry(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setCountry(java.lang.String): [0x31] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setDateOfBirth(int, com.braze.enums.Month, int) failed to verify: boolean com.braze.BrazeUser.setDateOfBirth(int, com.braze.enums.Month, int): [0x4A] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setEmail(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setEmail(java.lang.String): [0xE8] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setEmailNotificationSubscriptionType(com.braze.enums.NotificationSubscriptionType) failed to verify: boolean com.braze.BrazeUser.setEmailNotificationSubscriptionType(com.braze.enums.NotificationSubscriptionType): [0x34] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setFirstName(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setFirstName(java.lang.String): [0x31] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setGender(com.braze.enums.Gender) failed to verify: boolean com.braze.BrazeUser.setGender(com.braze.enums.Gender): [0x34] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setHomeCity(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setHomeCity(java.lang.String): [0x31] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setLanguage(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setLanguage(java.lang.String): [0x31] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setLastName(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setLastName(java.lang.String): [0x31] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setPhoneNumber(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setPhoneNumber(java.lang.String): [0xE9] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.unsetCustomUserAttribute(java.lang.String) failed to verify: boolean com.braze.BrazeUser.unsetCustomUserAttribute(java.lang.String): [0x3F] expected to be within a catch-all for an instruction where a monitor is held (declaration of 'com.braze.BrazeUser' appears in /data/app/~~cmQm-jpro2nu-QTvNDL3qw==/com.google.samples.apps.nowinandroid.demo.debug-pN6Fr6M1-ZqnjBJFClDhgQ==/base.apk!classes13.dex)
                        java.lang.VerifyError: Verifier rejected class com.braze.BrazeUser: boolean com.braze.BrazeUser.setCountry(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setCountry(java.lang.String): [0x31] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setDateOfBirth(int, com.braze.enums.Month, int) failed to verify: boolean com.braze.BrazeUser.setDateOfBirth(int, com.braze.enums.Month, int): [0x4A] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setEmail(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setEmail(java.lang.String): [0xE8] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setEmailNotificationSubscriptionType(com.braze.enums.NotificationSubscriptionType) failed to verify: boolean com.braze.BrazeUser.setEmailNotificationSubscriptionType(com.braze.enums.NotificationSubscriptionType): [0x34] expected to be within a catch-all for an instruction where a monitor is held
Braze v31.1.0 .n80       boolean com.braze.BrazeUser.setFirstName(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setFirstName(java.lang.String): [0x31] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setGender(com.braze.enums.Gender) failed to verify: boolean com.braze.BrazeUser.setGender(com.braze.enums.Gender): [0x34] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setHomeCity(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setHomeCity(java.lang.String): [0x31] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setLanguage(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setLanguage(java.lang.String): [0x31] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setLastName(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setLastName(java.lang.String): [0x31] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.setPhoneNumber(java.lang.String) failed to verify: boolean com.braze.BrazeUser.setPhoneNumber(java.lang.String): [0xE9] expected to be within a catch-all for an instruction where a monitor is held
                         boolean com.braze.BrazeUser.unsetCustomUserAttribute(java.lang.String) failed to verify: boolean com.braze.BrazeUser.unsetCustomUserAttribute(java.lang.String): [0x3F] expected to be within a catch-all for an instruction where a monitor is held (declaration of 'com.braze.BrazeUser' appears in /data/app/~~cmQm-jpro2nu-QTvNDL3qw==/com.google.samples.apps.nowinandroid.demo.debug-pN6Fr6M1-ZqnjBJFClDhgQ==/base.apk!classes13.dex)
                            at com.braze.Braze.setUserSpecificMemberVariablesAndStartDispatch(SourceFile:1321)
                            at com.braze.Braze.access$setUserSpecificMemberVariablesAndStartDispatch(SourceFile:110)
                            at com.braze.a.invoke(SourceFile:78)
                            at bo.app.f6.invokeSuspend(SourceFile:1449)
                            at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                            at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
                            at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:277)
                            at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:95)
                            at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
                            at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source:1)
                            at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:48)
                            at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source:1)
                            at bo.app.g6.invokeSuspend(SourceFile:1440)
                            at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)


### Additional Information

_No response_
radixdev commented 1 month ago
  1. What is your Android Gradle plugin version?
  2. What version of r8 are you using?
sujin-kk commented 1 month ago

@radixdev

  1. I use 8.4.1 of Android Gradle Plugin
  2. I use 8.4.26 of r8
le-tyang commented 1 month ago

Same happened to us. Tried on 31.0.0, 30.4.0 same error.

Could the issue be caused from this?

Fixed an issue with com.braze.support.DateTimeUtils.nowInMilliseconds() where, in the event of the device network time clock not being available, the SDK would continually log about the error.

radixdev commented 4 days ago

Hi @sujin-kk @le-tyang

Can one of you provide a small sample project and reproducible steps of the issue?