qiscus / qiscus-multichannel-widget-android

2 stars 4 forks source link

Crash when tried to implement FCM #4

Closed kadaluarsa closed 3 years ago

kadaluarsa commented 3 years ago

Hi guys I notice you already fixed the exoplayer issue and thanks for it, but now we have another issue when we tried to implement FCM+qiscus in our application, we already following the documentation but somehow our application crash at runtime here is the logcat : I thought its an issue from SDK because the stack trace says it is some part that need to take a note is Lcom/google/firebase/iid/FirebaseInstanceId we manage to fix it by implementing this

 implementation("com.google.firebase:firebase-iid"){
        because("qiscus SDK always crash without it")
    }

and here is our logcat when the crash happens:


        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:59)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/firebase/iid/FirebaseInstanceId;
        at com.qiscus.sdk.chat.core.QiscusCore.configureFcmToken(QiscusCore.java:920)
        at com.qiscus.sdk.chat.core.QiscusCore.lambda$setUserWithIdentityToken$3$QiscusCore(QiscusCore.java:724)
        at com.qiscus.sdk.chat.core.-$$Lambda$QiscusCore$7suKjVqETWluUOaO1jRIGMtrS9c.call(Unknown Source:4)
        at rx.internal.util.ActionObserver.onNext(ActionObserver.java:39)
        at rx.internal.operators.OnSubscribeDoOnEach$DoOnEachSubscriber.onNext(OnSubscribeDoOnEach.java:96)
        at rx.internal.operators.OnSubscribeMap$MapSubscriber.onNext(OnSubscribeMap.java:77)
        at retrofit2.adapter.rxjava.BodyOnSubscribe$BodySubscriber.onNext(BodyOnSubscribe.java:51)
        at retrofit2.adapter.rxjava.BodyOnSubscribe$BodySubscriber.onNext(BodyOnSubscribe.java:39)
        at retrofit2.adapter.rxjava.CallArbiter.deliverResponse(CallArbiter.java:118)
        at retrofit2.adapter.rxjava.CallArbiter.emitResponse(CallArbiter.java:100)
        at retrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:46)
        at retrofit2.adapter.rxjava.CallExecuteOnSubscribe.call(CallExecuteOnSubscribe.java:24)
        at retrofit2.adapter.rxjava.BodyOnSubscribe.call(BodyOnSubscribe.java:36)
        at retrofit2.adapter.rxjava.BodyOnSubscribe.call(BodyOnSubscribe.java:28)
        at rx.Observable.unsafeSubscribe(Observable.java:10256)
        at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:48)
        at rx.internal.operators.OnSubscribeMap.call(OnSubscribeMap.java:33)
        at rx.Observable.unsafeSubscribe(Observable.java:10256)
        at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41)
        at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30)
        at rx.Observable.unsafeSubscribe(Observable.java:10256)
        at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.call(OperatorSubscribeOn.java:100)
        at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230)
        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:923) ```

Hope it helps qiscus team and others partner when integrating qiscus SDK
mmnuradityo commented 3 years ago

because we are still using firebase version 20, and we will fix this problem soon