firebase-android-sdk
firebase-android-sdk copied to clipboard
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.
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
I tried reverting back the config to the last stable verison I had in production
'com.google.gms:google-services:4.3.10'
firebase_bom = '30.1.0'
'com.google.android.gms:play-services-base:18.0.1'
'com.google.android.gms:play-services-tasks:18.0.1'
but it still causing the same issue
One suspicion is that this is due to some R8 shrinking in production builds but thats just a wild guess at this point
Thanks for reporting, @funkyidol. Any chance you could share code snippets or a MCVE of your issue? Also could you enable debug logging, reproduce, and provide the logcat output? To enable debug logging, call FirebaseFirestore.setLoggingEnabled(true)
Like I mentioned in the original post, this issue is happening only for a handful of users running Android 5 and/or Android 6 in the production environment.
That said, I will try to share what I can soon.
@funkyidol, from an older issue, I'm seeing "these NoClassDefFound errors seems to be introduced by pulling in dependencies that somehow conflict with Firestore."
Here an example of someone fixing this specific issue with CharMatcher by changing the guava version: https://stackoverflow.com/questions/58294726/error-java-lang-classnotfoundexception-didnt-find-class-com-google-firebase
Can you check is this will address your problem?
Thanks will try this out before I push the new public build today
Im currently using implementation 'com.google.guava:guava:27.0.1-android'
as a dependency and have now updated it to implementation 'com.google.guava:guava:31.1-android'
which is the latest version. Lets see if this fixes the issues
Here are the complete logs after enabling Firestore debug logs. Im able to repro the crash on an API 23 emulator
FirebaseApp I Device unlocked: initializing all Firebase APIs for app [DEFAULT]
DynamiteModule I Considering local module com.google.android.gms.measurement.dynamite:73 and remote module com.google.android.gms.measurement.dynamite:15
DynamiteModule I Selected local version of com.google.android.gms.measurement.dynamite
FA W Failed to register event listener on calling thread. Trying again on the dynamite thread.
FA V App measurement enabled for app package, google app id: com.x.x.debug, 1:655280081249:android:cb92871953d15d64801d20
FA I App measurement initialized, version: 64000
FA I To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
FA I To enable faster debug mode event logging run:
FA D Debug-level message logging enabled
FA V Persisting first open: 1663070053474
FA V App measurement setting deferred collection: false
FirebaseCrashlytics I Initializing Firebase Crashlytics 18.2.11 for
Glide W Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
FirebaseInitProvider I FirebaseApp initialization successful
FA V Checking service availability
FA V Service available
FA V Connecting to remote service
FA V Detected application was in foreground
FA V Session started, time: 397106
com.faceboo...ngsManager W Please set a value for AutoLogAppEventsEnabled. Set the flag to TRUE if you want to collect app install, app launch and in-app purchase events automatically. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-android#disable-auto-events.
com.faceboo...ngsManager W You haven't set a value for AdvertiserIDCollectionEnabled. Set the flag to TRUE if you want to collect Advertiser ID for better advertising and analytics results. To request user consent before collecting data, set the flag value to FALSE, then change to TRUE once user consent is received. Learn more: https://developers.facebook.com/docs/app-events/getting-started-app-events-android#disable-auto-events.
GraphRequest W Starting with v13 of the SDK, a client token must be embedded in your client code before making Graph API calls. Visit https://developers.facebook.com/docs/android/getting-started#client-token to learn how to implement this change.
FA V Connection attempt already in progress
FA I Tag Manager is not found and thus will not be used
FA V Connection attempt already in progress
FA V Connection attempt already in progress
FA V Connection attempt already in progress
GraphRequest W Starting with v13 of the SDK, a client token must be embedded in your client code before making Graph API calls. Visit https://developers.facebook.com/docs/android/getting-started#client-token to learn how to implement this change.
GraphRequest W Starting with v13 of the SDK, a client token must be embedded in your client code before making Graph API calls. Visit https://developers.facebook.com/docs/android/getting-started#client-token to learn how to implement this change.
Sentry D io.sentry.auto-init read: false
Sentry I Retrieving auto-init from AndroidManifest.xml
com.google....ckProvider D Enter this debug secret into the allow list in the Firebase Console for your project: f765973e-b1bd-4182-af97-62b47ef35b71
EnvisionApplication I onCreate: nightModeFlag 16
art W Before Android 4.1, method android.graphics.PorterDuffColorFilter androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
FA V onActivityCreated
SplashActivity I SplashActivity.onCreate:
GraphRequest W Starting with v13 of the SDK, a client token must be embedded in your client code before making Graph API calls. Visit https://developers.facebook.com/docs/android/getting-started#client-token to learn how to implement this change.
RemoteConfigRepo D RemoteConfigRepo.init: Initializing RemoteConfigRepo
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=1 for 253ms
Firestore I (24.1.2) [FirestoreClient]: Initializing. user=null
DynamiteModule W Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
DynamiteModule I Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
ProviderInstaller W Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
AnalyticsUtils D AnalyticsUtils.setupAnalytics: uid:null, email:null, name:null
MixpanelAPI.API E Can't identify with null distinct_id.
MixpanelAPI.API E Can't identify with null distinct_id.
SplashActivity D SplashActivity.onNewIntent: start
SplashActivity D SplashActivity.onNewIntent: handling push notification
FirebaseMessageHandler D FirebaseMessageHandler.appLaunch: isNotification:true isUserLoggedIn:false
FIAM.Headless I Starting InAppMessaging runtime with Installation ID fMNwqYI6Rs6GH1jgGJsOk5
System W ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86
AnalyticsUserIDStore W initStore should have been called before calling setUserID
ProviderInstaller W Failed to report request stats: reportRequestStats [class android.content.Context, long, long]
GraphRequest W Starting with v13 of the SDK, a client token must be embedded in your client code before making Graph API calls. Visit https://developers.facebook.com/docs/android/getting-started#client-token to learn how to implement this change.
Firestore I (24.1.2) [SQLiteSchema]: Migration from version 0 to 16 took 49 milliseconds
FA V Connection attempt already in progress
BluetoothAdapter E Bluetooth binder is null
FA V Connection attempt already in progress
FA V onActivityCreated
FA V Connection attempt already in progress
art I Background sticky concurrent mark sweep GC freed 12088(1066KB) AllocSpace objects, 12(240KB) LOS objects, 1% free, 17MB/17MB, paused 11.633ms total 41.813ms
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=3 for 511ms
NativeCrypto V Registering com/google/android/gms/org/conscrypt/NativeCrypto's 286 native methods...
Firestore I (24.1.2) [Persistence]: Starting transaction: build overlays
Firestore I (24.1.2) [Persistence]: Starting transaction: Start IndexManager
Firestore I (24.1.2) [Persistence]: Starting transaction: Start MutationQueue
Firestore I (24.1.2) [Persistence]: Starting transaction: Allocate target
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java7ExtendedSSLSession>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java7ExtendedSSLSession>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java8ExtendedSSLSession>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.android.gms.org.conscrypt.Java8ExtendedSSLSession>
ProviderInstaller I Installed default security provider GmsCore_OpenSSL
Firestore I (24.1.2) [QueryEngine]: Using full collection scan to execute query: Query(target=Query(app_config_flags/android order by __name__);limitType=LIMIT_TO_FIRST)
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.Supplier>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.Supplier>
art I Rejecting re-init on previously-failed class java.lang.Class<io.grpc.internal.GrpcUtil$5>
art I Rejecting re-init on previously-failed class java.lang.Class<io.grpc.internal.GrpcUtil$5>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.Predicate>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.Predicate>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
art I Rejecting re-init on previously-failed class java.lang.Class<com.google.common.base.CharMatcher>
BluetoothAdapter E Bluetooth binder is null
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=4 for 643ms
FIAM.Headless I went foreground
FA V Activity resumed, time: 398296
FIAM.Display I Binding to activity: com.x.x.LoginActivity
FIAM.Headless I Setting display event component
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=5 for 720ms
FIAM.Headless I Forcing fetch from service rather than cache. Test Device: false | App Fresh Install: true
FIAM.Headless I Recoverable exception while reading cache: /data/user/0/com.x.x.debug/files/fiam_impressions_store_file: open failed: ENOENT (No such file or directory)
FA V Connection attempt already in progress
FA V Connection attempt already in progress
FIAM.Headless I Setting display event component
art I Background sticky concurrent mark sweep GC freed 4979(459KB) AllocSpace objects, 8(160KB) LOS objects, 2% free, 21MB/22MB, paused 7.716ms total 27.774ms
OpenGLRenderer D Use EGL_SWAP_BEHAVIOR_PRESERVED: true
<no-tag> D HostConnection::get() New Host Connection established 0x98f69ac0, tid 5313
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=6 for 794ms
FA D Connected to remote service
FA V Processing queued up service tasks: 10
GraphRequest W Starting with v13 of the SDK, a client token must be embedded in your client code before making Graph API calls. Visit https://developers.facebook.com/docs/android/getting-started#client-token to learn how to implement this change.
Firestore W (24.1.2) [AsyncQueue]: Refused to enqueue task after panic
AndroidRuntime D Shutting down VM
GraphRequest W Starting with v13 of the SDK, a client token must be embedded in your client code before making Graph API calls. Visit https://developers.facebook.com/docs/android/getting-started#client-token to learn how to implement this change.
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=7 for 872ms
System W Ignoring header If-None-Match because its value was null.
System W Ignoring header If-None-Match because its value was null.
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=8 for 949ms
BluetoothAdapter E Bluetooth binder is null
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=9 for 1.028s
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=10 for 1.156s
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=11 for 1.282s
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=12 for 1.410s
art W Long monitor contention event with owner method=int libcore.io.Posix.recvfromBytes(java.io.FileDescriptor, java.lang.Object, int, int, int, java.net.InetSocketAddress) from Posix.java:4294967294 waiters=13 for 1.545s
BluetoothAdapter E Bluetooth binder is null
AndroidRuntime E FATAL EXCEPTION: main
Process: com.x.x.debug, PID: 5313
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$$ExternalSyntheticLambda3.run(D8$$SyntheticClass)
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:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.google.android.gms.tasks.RuntimeExecutionException: java.lang.RuntimeException: java.lang.NoClassDefFoundError: com.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$com-google-firebase-firestore-remote-FirestoreChannel(FirestoreChannel.java:124)
at com.google.firebase.firestore.remote.FirestoreChannel$$ExternalSyntheticLambda2.onComplete(D8$$SyntheticClass)
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.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: com.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$com-google-firebase-firestore-util-ThrottledForwardingExecutor(ThrottledForwardingExecutor.java:54)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor$$ExternalSyntheticLambda0.run(D8$$SyntheticClass)
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: com.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$com-google-firebase-firestore-remote-GrpcCallProvider(GrpcCallProvider.java:242)
at com.google.firebase.firestore.remote.GrpcCallProvider$$ExternalSyntheticLambda6.call(D8$$SyntheticClass)
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$com-google-firebase-firestore-util-ThrottledForwardingExecutor(ThrottledForwardingExecutor.java:54)
at com.google.firebase.firestore.util.ThrottledForwardingExecutor$$ExternalSyntheticLambda0.run(D8$$SyntheticClass)
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)
FirebaseInstanceId W Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval
MessengerIpcClient W Timing out request: 1
FirebaseInstanceId W Token retrieval failed: SERVICE_NOT_AVAILABLE. Will retry token retrieval
- package name hidden for security reasons
The issue seems to be fixed after updating to implementation 'com.google.guava:guava:31.1-android'
. Rest I can confirm in a few days after pushing the build to Play Store
Thanks @MarkDuckworth for the tip
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):
Exception io.reactivex.exceptions.UndeliverableException: java.lang.NoClassDefFoundError: com.google.common.base.CharMatcher
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: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 java.lang.Thread.run (Thread.java:818)
Caused by java.lang.NoClassDefFoundError: com.google.common.base.CharMatcher
at com.google.common.base.Splitter.on (Splitter.java:129)
at io.grpc.internal.GrpcUtil.<clinit> (GrpcUtil.java:203)
at io.grpc.okhttp.OkHttpChannelBuilder.<init> (OkHttpChannelBuilder.java:174)
at io.grpc.okhttp.OkHttpChannelBuilder.forTarget (OkHttpChannelBuilder.java:149)
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.inappmessaging.internal.injection.modules.GrpcChannelModule.providesGrpcChannel (GrpcChannelModule.java:41)
at com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.providesGrpcChannel (GrpcChannelModule_ProvidesGrpcChannelFactory.java:39)
at com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.get (GrpcChannelModule_ProvidesGrpcChannelFactory.java:30)
at com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.get (GrpcChannelModule_ProvidesGrpcChannelFactory.java:9)
at com.google.firebase.inappmessaging.dagger.internal.DoubleCheck.get (DoubleCheck.java:47)
at com.google.firebase.inappmessaging.internal.injection.components.DaggerUniversalComponent.gRPCChannel (DaggerUniversalComponent.java:180)
at com.google.firebase.inappmessaging.internal.injection.components.DaggerAppComponent$com_google_firebase_inappmessaging_internal_injection_components_UniversalComponent_gRPCChannel.get (DaggerAppComponent.java:309)
at com.google.firebase.inappmessaging.internal.injection.components.DaggerAppComponent$com_google_firebase_inappmessaging_internal_injection_components_UniversalComponent_gRPCChannel.get (DaggerAppComponent.java:299)
at com.google.firebase.inappmessaging.internal.injection.modules.GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.get (GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.java:35)
at com.google.firebase.inappmessaging.internal.injection.modules.GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.get (GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.java:11)
at com.google.firebase.inappmessaging.dagger.internal.DoubleCheck.get (DoubleCheck.java:47)
at com.google.firebase.inappmessaging.internal.GrpcClient_Factory.get (GrpcClient_Factory.java:26)
at com.google.firebase.inappmessaging.internal.GrpcClient_Factory.get (GrpcClient_Factory.java:8)
at com.google.firebase.inappmessaging.dagger.internal.DoubleCheck.get (DoubleCheck.java:47)
at com.google.firebase.inappmessaging.internal.ApiClient.getFiams (ApiClient.java:72)
at com.google.firebase.inappmessaging.internal.InAppMessageStreamManager.lambda$createFirebaseInAppMessageStream$16$com-google-firebase-inappmessaging-internal-InAppMessageStreamManager (InAppMessageStreamManager.java:261)
at com.google.firebase.inappmessaging.internal.InAppMessageStreamManager$$ExternalSyntheticLambda16.apply (D8$$SyntheticClass)
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)
We see the same issue:
io.reactivex.exceptions.UndeliverableException: The exception could not be delivered to the consumer because it has already canceled/disposed the flow or the exception has nowhere to go to begin with. Further reading: https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/base/CharMatcher;
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:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
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.inappmessaging.internal.injection.modules.GrpcChannelModule.providesGrpcChannel(GrpcChannelModule.java:41)
at com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.providesGrpcChannel(GrpcChannelModule_ProvidesGrpcChannelFactory.java:39)
at com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.get(GrpcChannelModule_ProvidesGrpcChannelFactory.java:30)
at com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.get(GrpcChannelModule_ProvidesGrpcChannelFactory.java:9)
at com.google.firebase.inappmessaging.dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.google.firebase.inappmessaging.internal.injection.components.DaggerUniversalComponent.gRPCChannel(DaggerUniversalComponent.java:180)
at com.google.firebase.inappmessaging.internal.injection.components.DaggerAppComponent$com_google_firebase_inappmessaging_internal_injection_components_UniversalComponent_gRPCChannel.get(DaggerAppComponent.java:309)
at com.google.firebase.inappmessaging.internal.injection.components.DaggerAppComponent$com_google_firebase_inappmessaging_internal_injection_components_UniversalComponent_gRPCChannel.get(DaggerAppComponent.java:299)
at com.google.firebase.inappmessaging.internal.injection.modules.GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.get(GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.java:35)
at com.google.firebase.inappmessaging.internal.injection.modules.GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.get(GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.java:11)
at com.google.firebase.inappmessaging.dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.google.firebase.inappmessaging.internal.GrpcClient_Factory.get(GrpcClient_Factory.java:26)
at com.google.firebase.inappmessaging.internal.GrpcClient_Factory.get(GrpcClient_Factory.java:8)
at com.google.firebase.inappmessaging.dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
at com.google.firebase.inappmessaging.internal.ApiClient.getFiams(ApiClient.java:72)
Adding Guava in different versions didn't help.
@funkyidol Do you have any update if Guava 31.1-android did the trick for you?
edit: #1922 @dconeybe multiDexKeepFile file('com.google.common.base.CharMatcher')
and/or multiDexKeepProguard file('com.google.common.base.CharMatcher$Is')
don't help.
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:
implementation ("com.google.guava:guava") {
version{
strictly '31.1-android'
}
}
@Farasy, Thanks for posting the fix that worked for you. @Grandpasoul, does the same solution resolve your conflict when using In-App Messaging?
@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
@MarkDuckworth on emulator we can still reproduce the issue with Firebase In-App Messaging in Android 5 and 6, with or without Guava 31.1 or below as I posted. But in the Google Play console we are not having more issues. We don't know if users are uninstalling our app or maybe they are updating their Android versions.
Since this seems to have migrated out of Firestore into more general Firebase Android SDK territory, I'm checking with @VinayGuthal to see if he might have some ideas.
Hi all, just cleaning up some threads. Since @funkyidol & @Farasy's issue has been fixed, I'll close this issue now.
Hi @Grandpasoul, given that your issue(FIAM) is different from theirs (Firestore), if you still experience this issue, it might be best if you open a new thread, so that we can assist you better.
If you guys feel this is a mistake for closing, let me know and we can always reopen this. Thanks all!