firebase-android-sdk: Multiple java.lang.ClassNotFoundException in Cloud Firestore (24.1.2)
Since past few months we have been seeing a huge influx of crash issues in the Firestore SDK in our production version of our app Config which is causing the issue:
'com.google.gms:google-services:4.3.13'
firebase_bom = '30.3.2'
'com.google.android.gms:play-services-base:18.1.0'
'com.google.android.gms:play-services-tasks:18.0.2'
Please find the logs below
Fatal Exception: java.lang.RuntimeException: Internal error in Cloud Firestore (24.1.2).
at com.google.firebase.firestore.util.AsyncQueue.lambda$panic$3(AsyncQueue.java:539)
at com.google.firebase.firestore.util.AsyncQueue.$r8$lambda$jx84dqgUsF4ojecSMurRqFLFD1Y(AsyncQueue.java)
at com.google.firebase.firestore.util.AsyncQueue$$InternalSyntheticLambda$0$ee0bb9e76d873eb0dc9297d9a9af24cf74be4371507e5d9f6cdb6af965a9e57b$0.run(AsyncQueue.java)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7406)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Caused by com.google.android.gms.tasks.RuntimeExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/base/CharMatcher;
at com.google.android.gms.tasks.zzw.getResult(com.google.android.gms:play-services-tasks@@18.0.2:3)
at com.google.firebase.firestore.remote.FirestoreChannel.lambda$runBidiStreamingRpc$0(FirestoreChannel.java:124)
at com.google.firebase.firestore.remote.FirestoreChannel.$r8$lambda$ThFui-hvcsrVGYxlBtcTH5vVbvE(FirestoreChannel.java)
at com.google.firebase.firestore.remote.FirestoreChannel$$InternalSyntheticLambda$0$f566b4153b534aa8580aa93faa9c580a04c89fec85c27cb978c537b6c327c368$0.onComplete(FirestoreChannel.java)
at com.google.android.gms.tasks.zzi.run(com.google.android.gms:play-services-tasks@@18.0.2:1)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:154)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$DelayedStartFactory.run(AsyncQueue.java:234)
at java.lang.Thread.run(Thread.java:818)
Caused by java.lang.RuntimeException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/base/CharMatcher;
at com.google.android.gms.tasks.zzz.run(com.google.android.gms:play-services-tasks@@18.0.2:2)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.lambda$execute$0(ThrottledForwardingExecutor.java:54)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.$r8$lambda$MfIJbVuxZtLwosAgPzPA-cU66Ko(ThrottledForwardingExecutor.java)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor$$InternalSyntheticLambda$0$315eca65e330db056b7a49c0f4857da93273eb5e29c07cc873bd0f103d01177e$0.run(ThrottledForwardingExecutor.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/base/CharMatcher;
at com.google.common.base.Splitter.on(Splitter.java:129)
at io.grpc.internal.GrpcUtil.<clinit>(GrpcUtil.java:205)
at io.grpc.okhttp.OkHttpChannelBuilder.<init>(OkHttpChannelBuilder.java:181)
at io.grpc.okhttp.OkHttpChannelBuilder.forTarget(OkHttpChannelBuilder.java:156)
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:47)
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:27)
at io.grpc.ManagedChannelBuilder.forTarget(ManagedChannelBuilder.java:76)
at com.google.firebase.firestore.remote.GrpcCallProvider.initChannel(GrpcCallProvider.java:99)
at com.google.firebase.firestore.remote.GrpcCallProvider.lambda$initChannelTask$6(GrpcCallProvider.java:242)
at com.google.firebase.firestore.remote.GrpcCallProvider.$r8$lambda$SCD5iiibQ8l4haiO8ofSfE0wIJg(GrpcCallProvider.java)
at com.google.firebase.firestore.remote.GrpcCallProvider$$InternalSyntheticLambda$1$24dfe1452828c34b25291fc0adb6cd3bc1502d531cb543765315882230811d05$0.call(GrpcCallProvider.java)
at com.google.android.gms.tasks.zzz.run(com.google.android.gms:play-services-tasks@@18.0.2:1)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.lambda$execute$0(ThrottledForwardingExecutor.java:54)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.$r8$lambda$MfIJbVuxZtLwosAgPzPA-cU66Ko(ThrottledForwardingExecutor.java)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor$$InternalSyntheticLambda$0$315eca65e330db056b7a49c0f4857da93273eb5e29c07cc873bd0f103d01177e$0.run(ThrottledForwardingExecutor.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by java.lang.ClassNotFoundException: Didn't find class "com.google.common.base.CharMatcher" on path: DexPathList[[zip file "/data/app/com.letsenvision.envisionai-1/base.apk"],nativeLibraryDirectories=[/data/app/com.letsenvision.envisionai-1/lib/arm, /data/app/com.letsenvision.envisionai-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.google.common.base.Splitter.on(Splitter.java:129)
at io.grpc.internal.GrpcUtil.<clinit>(GrpcUtil.java:205)
at io.grpc.okhttp.OkHttpChannelBuilder.<init>(OkHttpChannelBuilder.java:181)
at io.grpc.okhttp.OkHttpChannelBuilder.forTarget(OkHttpChannelBuilder.java:156)
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:47)
at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:27)
at io.grpc.ManagedChannelBuilder.forTarget(ManagedChannelBuilder.java:76)
at com.google.firebase.firestore.remote.GrpcCallProvider.initChannel(GrpcCallProvider.java:99)
at com.google.firebase.firestore.remote.GrpcCallProvider.lambda$initChannelTask$6(GrpcCallProvider.java:242)
at com.google.firebase.firestore.remote.GrpcCallProvider.$r8$lambda$SCD5iiibQ8l4haiO8ofSfE0wIJg(GrpcCallProvider.java)
at com.google.firebase.firestore.remote.GrpcCallProvider$$InternalSyntheticLambda$1$24dfe1452828c34b25291fc0adb6cd3bc1502d531cb543765315882230811d05$0.call(GrpcCallProvider.java)
at com.google.android.gms.tasks.zzz.run(com.google.android.gms:play-services-tasks@@18.0.2:1)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.lambda$execute$0(ThrottledForwardingExecutor.java:54)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor.$r8$lambda$MfIJbVuxZtLwosAgPzPA-cU66Ko(ThrottledForwardingExecutor.java)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor$$InternalSyntheticLambda$0$315eca65e330db056b7a49c0f4857da93273eb5e29c07cc873bd0f103d01177e$0.run(ThrottledForwardingExecutor.java)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
One interesting thing to note is that these issues are only coming for users who are on Android 5 and Android 6. You can see this in the screenshots from the crashlytics.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 18 (6 by maintainers)
@Farasy Yes upgrading to the Guava Android 31.1 worked for us in production as well and now the app is once again stable for older Android versions
So, what helps is to set the Guava version strictly as it looks that at least one dependency in the jungle uses a different version:
The issue still happen in Android 6 and 5 with the InApp Messaging implementation, even with the next guava versions:
implementation 'com.google.guava:guava:31.1-android'
implementation 'com.google.guava:guava:28.0-android'
implementation 'com.google.guava:guava:27.0.1-android'
Here is the stacktrace (from emulator Pixel 3 API 23):