plaidev / karte-android-sdk

KARTE SDK for Android
https://karte.io/
Apache License 2.0
5 stars 3 forks source link

[notifications] App crashes when build with firebase-messaging:22.0.0 #13

Closed wasnot closed 3 years ago

wasnot commented 3 years ago

Expected Behavior

SDK works properly without a crash.

Current Behavior

Application will crash when launching.

Possible Solution

~Build with firebase-messaging:21.1.0 or lower.~

This issue has been fixed in notifications 2.7.1 https://developers.karte.io/docs/release-notes-android-sdk-v2#notifications-271

Steps to Reproduce

  1. Implement the SDK and launch the app

SDK Version

Build Environment

Context Details

Logs

    java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/iid/FirebaseInstanceId;
        at io.karte.android.notifications.c.f.f(:86)
        at io.karte.android.notifications.c.f.k(:53)
        at io.karte.android.notifications.c.f.l(:51)
        at io.karte.android.notifications.a.onActivityResumed(:64)
        at android.app.Application.dispatchActivityResumed(Application.java:436)
        at android.app.Activity.dispatchActivityResumed(Activity.java:1265)
        at android.app.Activity.onResume(Activity.java:1789)
        at androidx.fragment.app.c.onResume(:456)
        at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1446)
        at android.app.Activity.performResume(Activity.java:7939)
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4195)
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4237)
        at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52)
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
        at android.os.Handler.dispatchMessage(Handler.java:107)
        at android.os.Looper.loop(Looper.java:214)
        at android.app.ActivityThread.main(ActivityThread.java:7356)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.iid.FirebaseInstanceId" on path: DexPathList[[zip file "/data/app/io.karte.sdk_test-GIBzXK3phzA_Gr6kdl_UBQ==/base.apk"],nativeLibraryDirectories=[/data/app/io.karte.sdk_test-GIBzXK3phzA_Gr6kdl_UBQ==/lib/x86, /system/lib, /system/product/lib]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at io.karte.android.notifications.c.f.f(:86) 
        at io.karte.android.notifications.c.f.k(:53) 
        at io.karte.android.notifications.c.f.l(:51) 
        at io.karte.android.notifications.a.onActivityResumed(:64) 
        at android.app.Application.dispatchActivityResumed(Application.java:436) 
        at android.app.Activity.dispatchActivityResumed(Activity.java:1265) 
        at android.app.Activity.onResume(Activity.java:1789) 
        at androidx.fragment.app.c.onResume(:456) 
        at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1446) 
        at android.app.Activity.performResume(Activity.java:7939) 
        at android.app.ActivityThread.performResumeActivity(ActivityThread.java:4195) 
        at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:4237) 
        at android.app.servertransaction.ResumeActivityItem.execute(ResumeActivityItem.java:52) 
        at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:176) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) 
        at android.os.Handler.dispatchMessage(Handler.java:107) 
        at android.os.Looper.loop(Looper.java:214) 
        at android.app.ActivityThread.main(ActivityThread.java:7356) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 

Possible Implementation

wasnot commented 3 years ago

This issue has been fixed in notifications 2.7.1 https://developers.karte.io/docs/release-notes-android-sdk-v2#notifications-271