firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.25k stars 571 forks source link

In-App Messaging crashing with R8 + ProGuard #5746

Closed ArcherEmiya05 closed 5 months ago

ArcherEmiya05 commented 6 months ago

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

[REQUIRED] Step 2: Describe your environment

[REQUIRED] Step 3: Describe the problem

Crash caused by In-App Messaging when using R8 + ProGuard

Steps to reproduce:

Running app with R8 + ProGuard using AGP 8.2.2 and Gradle 8.2

Relevant Code:

E  FATAL EXCEPTION: RxCachedThreadScheduler-2
                 Process: com.sample.app, PID: 24609
                 io.reactivex.exceptions.UndeliverableException: java.lang.NoClassDefFoundError: Failed resolution of: Lio/grpc/ForwardingClientCallListener$SimpleForwardingClientCallListener;
                    at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
                    at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69)
                    at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
                    at java.util.concurrent.FutureTask.run(FutureTask.java:264)
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307)
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                    at java.lang.Thread.run(Thread.java:1012)
                 Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lio/grpc/ForwardingClientCallListener$SimpleForwardingClientCallListener;
                    at com.android.tools.appinspection.network.grpc.GrpcInterceptor.interceptCall(GrpcInterceptor.kt:48)
                    at com.android.tools.appinspection.network.NetworkInspector$InterceptingGrpcChannel.newCall(NetworkInspector.kt:364)
                    at io.grpc.internal.ManagedChannelImpl.newCall(ManagedChannelImpl.java:901)
                    at io.grpc.internal.ForwardingManagedChannel.newCall(ForwardingManagedChannel.java:63)
                    at io.grpc.stub.MetadataUtils$HeaderAttachingClientInterceptor.interceptCall(MetadataUtils.java:81)
                    at io.grpc.ClientInterceptors$InterceptorChannel.newCall(ClientInterceptors.java:156)
                    at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:154)
                    at com.google.internal.firebase.inappmessaging.v1.sdkserving.InAppMessagingSdkServingGrpc$InAppMessagingSdkServingBlockingStub.fetchEligibleCampaigns(InAppMessagingSdkServingGrpc.java:222)
                    at com.google.firebase.inappmessaging.internal.GrpcClient.fetchEligibleCampaigns(GrpcClient.java:39)
                    at com.google.firebase.inappmessaging.internal.ApiClient.getFiams(ApiClient.java:73)
                    at com.google.firebase.inappmessaging.internal.InAppMessageStreamManager.lambda$createFirebaseInAppMessageStream$16(InAppMessageStreamManager.java:266)
                    at com.google.firebase.inappmessaging.internal.InAppMessageStreamManager.$r8$lambda$VxyUxgR76CW5pjlBPvp43BItTTQ(InAppMessageStreamManager.java:0)
                    at com.google.firebase.inappmessaging.internal.InAppMessageStreamManager$$ExternalSyntheticLambda24.apply(R8$$SyntheticClass:0)
                    at io.reactivex.internal.operators.maybe.MaybeMap$MapMaybeObserver.onSuccess(MaybeMap.java:82)
                    at io.reactivex.internal.operators.maybe.MaybeFilter$FilterMaybeObserver.onSuccess(MaybeFilter.java:89)
                    at io.reactivex.internal.operators.maybe.MaybeObserveOn$ObserveOnMaybeObserver.run(MaybeObserveOn.java:104)
                    at io.reactivex.Scheduler$DisposeTask.run(Scheduler.java:579)
                    at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66)
                    at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) 
                    at java.util.concurrent.FutureTask.run(FutureTask.java:264) 
                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) 
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) 
                    at java.lang.Thread.run(Thread.java:1012) 
                 Caused by: java.lang.ClassNotFoundException: Didn't find class "io.grpc.ForwardingClientCallListener$SimpleForwardingClientCallListener" on path: DexPathList[[zip file "/data/local/tmp/perfd/network-inspector.jar"],nativeLibraryDirectories=[/system/lib64, /system/system_ext/lib64]]
                    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
                    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
google-oss-bot commented 6 months ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

lehcar09 commented 6 months ago

Hi @ArcherEmiya05, thank you for reaching out. I tried replicating the issue, but I was unsuccessful. Could you share the configuration you're using in your proguard? if possible, could you provide an MCVE that can help us investigate the issue?

google-oss-bot commented 6 months ago

Hey @ArcherEmiya05. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 5 months ago

Since there haven't been any recent updates here, I am going to close this issue.

@ArcherEmiya05 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.