-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Firestore Promises never complete when running app for testing with detox on Android #3981
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions! For more information on bots in this repository, read this discussion. |
The issue has been closed for inactivity. |
I ran into this issue too today on detox v20.12.1 ... I found this issue: I am working on an unejected expo project (expo + detox + firebase), so things are a bit extra tricky sometimes. Below is the error message that I see in As far as I understand, the error below suggests that Protocol Buffers is not available as required by Cloud Firestore. This seems to be related to the an update in Espresso 3.4.0 as suggested here: Rolling back to detox 20.0.3 solves the issue (but raises other problems in our setup). I would like to propose to reopen this issue.
|
What happened?
I have encountered an issue where, when the app is run for detox tests, firestore promises never complete, successfully or otherwise. This effectively causes the app to become idle.
This appears to be caused by a conflict between versions of protobuf-lite when running the instrumented version of the app required by detox. I found a workaround in issue #3957 in this comment
I'm creating this as a separate issue because the behavior described there is completely different to the behavior I experienced, and since the required device logs are not surfaced by the react-native CLI it took me a long time to discover the route cause. In fact I only discovered it when following the instructions to create the original version of this issue, which did not include a root cause or a workaround
I'm pretty new to react native, which may have been the cause of it taking me so long to discover the detailed device logs but it may be worthwhile including the
--record-logs all
step in your troubleshooting guide. I'm happy to submit a PR for that if it is felt appropriate.What was the expected behaviour?
Firestore promises complete.
Was it tested on latest Detox?
Did your test throw out a timeout?
Help us reproduce this issue!
I created a simple test project to reproduce this behavior but I am not sure how to sanitise it for public release since it includes firebase client config. I'm happy to give access to people from this project who require it though
In what environment did this happen?
Detox version: 20.5.0
React Native version: 10.2.0
Has Fabric (React Native's new rendering system) enabled: I don't know. If this is enabled by default on new react native apps then yes, otherwise no.
Node version: v16.19.1
Device model: Android Emulator (Pixel 5)
Android version: 12
Test-runner (select one): jest
Detox logs
Detox logs
Github is complaining that the body is too long when I include this so I have placed it in this gist
Device logs
Device logs
I'm only including what appears to be the appropriate block here, since the full logs are huge. I can provide full logs on request ``` 03-15 11:02:07.327 19922 19922 E detox : at java.lang.reflect.Method.invoke(Native Method) 03-15 11:02:07.327 19922 19922 E detox : at org.joor.Reflect.on(Reflect.java:723) 03-15 11:02:07.327 19922 19922 E detox : at org.joor.Reflect.call(Reflect.java:427) 03-15 11:02:07.327 19922 19922 E detox : at com.wix.detox.espresso.UiAutomatorHelper$2.run(UiAutomatorHelper.java:60) 03-15 11:02:07.327 19922 19922 E detox : at com.wix.detox.common.UIThread.postSync$lambda-0(UIThread.kt:19) 03-15 11:02:07.327 19922 19922 E detox : at com.wix.detox.common.UIThread.$r8$lambda$_Z79tZbTHJk11n0eI4HC0LzUHu0(Unknown Source:0) 03-15 11:02:07.327 19922 19922 E detox : at com.wix.detox.common.UIThread$$ExternalSyntheticLambda1.call(Unknown Source:2) 03-15 11:02:07.327 19922 19922 E detox : at java.util.concurrent.FutureTask.run(FutureTask.java:266) 03-15 11:02:07.327 19922 19922 E detox : at android.os.Handler.handleCallback(Handler.java:938) 03-15 11:02:07.327 19922 19922 E detox : at android.os.Handler.dispatchMessage(Handler.java:99) 03-15 11:02:07.327 19922 19922 E detox : at android.os.Looper.loopOnce(Looper.java:201) 03-15 11:02:07.327 19922 19922 E detox : at android.os.Looper.loop(Looper.java:288) 03-15 11:02:07.327 19922 19922 E detox : at android.app.ActivityThread.main(ActivityThread.java:7839) 03-15 11:02:07.327 19922 19922 E detox : at java.lang.reflect.Method.invoke(Native Method) 03-15 11:02:07.327 19922 19922 E detox : at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 03-15 11:02:07.327 19922 19922 E detox : at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) 03-15 11:02:07.327 19922 19922 E detox : Caused by: java.lang.RuntimeException: Internal error in Cloud Firestore (24.4.4). 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.util.AsyncQueue.lambda$panic$3(AsyncQueue.java:545) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.util.AsyncQueue$$ExternalSyntheticLambda6.run(Unknown Source:2) 03-15 11:02:07.327 19922 19922 E detox : at android.os.Handler.handleCallback(Handler.java:938) 03-15 11:02:07.327 19922 19922 E detox : at android.os.Handler.dispatchMessage(Handler.java:99) 03-15 11:02:07.327 19922 19922 E detox : at androidx.test.espresso.base.Interrogator.loopAndInterrogate(Interrogator.java:14) 03-15 11:02:07.327 19922 19922 E detox : at androidx.test.espresso.base.UiControllerImpl.loopUntil(UiControllerImpl.java:8) 03-15 11:02:07.327 19922 19922 E detox : at androidx.test.espresso.base.UiControllerImpl.loopMainThreadUntilIdle(UiControllerImpl.java:17) 03-15 11:02:07.327 19922 19922 E detox : at androidx.test.espresso.base.UiControllerImpl.loopMainThreadForAtLeast(UiControllerImpl.java:9) 03-15 11:02:07.327 19922 19922 E detox : ... 16 more 03-15 11:02:07.327 19922 19922 E detox : Caused by: java.lang.NoSuchMethodError: No static method registerDefaultInstance(Ljava/lang/Class;Lcom/google/protobuf/GeneratedMessageLite;)V in class Lcom/google/protobuf/GeneratedMessageLite; or its super classes (declaration of 'com.google.protobuf.GeneratedMessageLite' appears in /data/app/~~o6Va_QOWxjJTA8dkrym2_Q==/com.targetproject.test-8xSu5j_gH9tvFACNz_CEiA==/base.apk) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firestore.v1.ListenRequest.(ListenRequest.java:873) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firestore.v1.ListenRequest.getDefaultInstance(ListenRequest.java:878) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firestore.v1.FirestoreGrpc.getListenMethod(FirestoreGrpc.java:414) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.remote.WatchStream.(WatchStream.java:61) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.remote.Datastore.createWatchStream(Datastore.java:138) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.remote.RemoteStore.(RemoteStore.java:171) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.core.MemoryComponentProvider.createRemoteStore(MemoryComponentProvider.java:77) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.core.ComponentProvider.initialize(ComponentProvider.java:153) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.core.FirestoreClient.initialize(FirestoreClient.java:292) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.core.FirestoreClient.lambda$new$0$com-google-firebase-firestore-core-FirestoreClient(FirestoreClient.java:111) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.core.FirestoreClient$$ExternalSyntheticLambda12.run(Unknown Source:8) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.util.AsyncQueue.lambda$enqueue$2(AsyncQueue.java:444) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.util.AsyncQueue$$ExternalSyntheticLambda0.call(Unknown Source:2) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor.lambda$executeAndReportResult$1(AsyncQueue.java:330) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$$ExternalSyntheticLambda2.run(Unknown Source:4) 03-15 11:02:07.327 19922 19922 E detox : at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) 03-15 11:02:07.327 19922 19922 E detox : at java.util.concurrent.FutureTask.run(FutureTask.java:266) 03-15 11:02:07.327 19922 19922 E detox : at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) 03-15 11:02:07.327 19922 19922 E detox : at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 03-15 11:02:07.327 19922 19922 E detox : at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 03-15 11:02:07.327 19922 19922 E detox : at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$DelayedStartFactory.run(AsyncQueue.java:235) 03-15 11:02:07.327 19922 19922 E detox : at java.lang.Thread.run(Thread.java:920) 03-15 11:02:07.433 19922 20045 D nativeloader: classloader namespace configured for unbundled product apk. library_path=/product/priv-app/PrebuiltGmsCore/lib/x86_64:/product/priv-app/PrebuiltGmsCore/PrebuiltGmsCore.apk!/lib/x86_64:/product/lib64:/system/product/lib64 03-15 11:02:07.457 19922 20045 I m.targetprojec: Waiting for a blocking GC ClassLinker 03-15 11:02:07.499 19922 20045 I m.targetprojec: WaitForGcToComplete blocked ClassLinker on Background for 41.355ms 03-15 11:02:07.501 19922 19933 W System : A resource failed to call close. 03-15 11:02:07.547 19922 20045 V NativeCrypto: Registering com/google/android/gms/org/conscrypt/NativeCrypto's 295 native methods... 03-15 11:02:07.573 19922 20045 W m.targetprojec: Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (unsupported, reflection, allowed) 03-15 11:02:07.618 19922 20045 I ProviderInstaller: Installed default security provider GmsCore_OpenSSL 03-15 11:02:07.648 19922 20045 W Firestore: (24.4.4) [AsyncQueue]: Refused to enqueue task after panicThe text was updated successfully, but these errors were encountered: