Skip to content
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

[Bug] Firestore crash when using Android emulator #1065

Open
Nyankoo opened this issue Jun 2, 2021 · 18 comments
Open

[Bug] Firestore crash when using Android emulator #1065

Nyankoo opened this issue Jun 2, 2021 · 18 comments
Labels
api: firestore blocked-by-dependencies Issues which is blocked by native Android/iOS SDK, backend or third-party dependencies. type: bug

Comments

@Nyankoo
Copy link

Nyankoo commented Jun 2, 2021

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2020.3.9f1
  • Firebase Unity SDK version: 7.2.0
  • Source you installed the SDK: Unity Package Manager with tgz
  • Problematic Firebase Component: Firestore
  • Other Firebase Components in use: Auth, Crashlytics, Remote Config
  • Additional SDKs you are using:
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting: Android
  • Scripting Runtime: IL2CPP

[REQUIRED] Please describe the issue here:

E/AndroidRuntime( 5020): FATAL EXCEPTION: main
E/AndroidRuntime( 5020): Process: com.example.game, PID: 5020
E/AndroidRuntime( 5020): java.lang.Error: FATAL EXCEPTION [main]
E/AndroidRuntime( 5020): Unity version     : 2020.3.9f1
E/AndroidRuntime( 5020): Device model      : samsung SM-G955N
E/AndroidRuntime( 5020): Device fingerprint: samsung/SM-G955N/dream2lteks:5.1.1/NRD90M/500200305:user/release-keys
E/AndroidRuntime( 5020): Build Type        : Release
E/AndroidRuntime( 5020): Scripting Backend : IL2CPP
E/AndroidRuntime( 5020): ABI               : armeabi-v7a
E/AndroidRuntime( 5020): Strip Engine Code : true

E/AndroidRuntime( 5020): Caused by: java.lang.RuntimeException: Internal error in Cloud Firestore (22.1.2).

E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.util.AsyncQueue.lambda$panic$3(AsyncQueue.java:534)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.util.AsyncQueue$$Lambda$3.run(AsyncQueue.java)
E/AndroidRuntime( 5020): 	at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime( 5020): 	at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 5020): 	at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime( 5020): 	at android.app.ActivityThread.main(ActivityThread.java:5307)
E/AndroidRuntime( 5020): 	at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 5020): 	at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime( 5020): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
E/AndroidRuntime( 5020): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
E/AndroidRuntime( 5020): Caused by: java.lang.IllegalArgumentException: Timestamp seconds out of range: 6967862201976803777
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.util.Preconditions.checkArgument(Preconditions.java:117)
E/AndroidRuntime( 5020): 	at com.google.firebase.Timestamp.validateRange(Timestamp.java:159)
E/AndroidRuntime( 5020): 	at com.google.firebase.Timestamp.<init>(Timestamp.java:63)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.remote.RemoteSerializer.decodeTimestamp(RemoteSerializer.java:110)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.remote.RemoteSerializer.decodeVersion(RemoteSerializer.java:121)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.remote.RemoteSerializer.decodeWatchChange(RemoteSerializer.java:873)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.remote.WatchStream.onNext(WatchStream.java:106)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.remote.WatchStream.onNext(WatchStream.java:38)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.remote.AbstractStream$StreamObserver.lambda$onNext$1(AbstractStream.java:119)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.remote.AbstractStream$StreamObserver$$Lambda$2.run(AbstractStream.java)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.remote.AbstractStream$CloseGuardedRunner.run(AbstractStream.java:67)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.remote.AbstractStream$StreamObserver.onNext(AbstractStream.java:110)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.remote.FirestoreChannel$1.onMessage(FirestoreChannel.java:125)
E/AndroidRuntime( 5020): 	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInternal(ClientCallImpl.java:658)
E/AndroidRuntime( 5020): 	at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:643)
E/AndroidRuntime( 5020): 	at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
E/AndroidRuntime( 5020): 	at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
E/AndroidRuntime( 5020): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
E/AndroidRuntime( 5020): 	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
E/AndroidRuntime( 5020): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
E/AndroidRuntime( 5020): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
E/AndroidRuntime( 5020): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
E/AndroidRuntime( 5020): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
E/AndroidRuntime( 5020): 	at com.google.firebase.firestore.util.AsyncQueue$SynchronizedShutdownAwareExecutor$DelayedStartFactory.run(AsyncQueue.java:229)
E/AndroidRuntime( 5020): 	at java.lang.Thread.run(Thread.java:818)
W/ActivityManager( 1779):   Force finishing activity 1 com.example.game/com.google.firebase.MessagingUnityPlayerActivity

Steps to reproduce:

Relevant Code:

@paulinon paulinon removed the new New issue. label Jun 3, 2021
@paulinon
Copy link
Contributor

paulinon commented Jun 3, 2021

Hi @Nyankoo,

In order to identify what's causing this behavior, could you share a minimal, reproducible example of your project along with the steps you've taken before facing this issue?

@paulinon paulinon added the needs-info Need information for the developer label Jun 3, 2021
@schmidt-sebastian
Copy link

Furthermore, are you able to share debug logs if this is reproducible? You can change the log level with this API: https://firebase.google.com/docs/reference/unity/namespace/firebase#namespace_firebase_1ae165d1d7bc3d85e1c0463a2a1d9ced9a

If you change the log level to DEBUG then will be able to see the messages that the SDK receives from the backend.

@schmidt-sebastian schmidt-sebastian self-assigned this Jun 3, 2021
@Nyankoo
Copy link
Author

Nyankoo commented Jun 3, 2021

@schmidt-sebastian I'm still trying to recreate this in a minimal repro, but in the meantime, you can find the complete logcat with DEBUG enabled here.

62001_logcat.txt

@google-oss-bot google-oss-bot added needs-attention Need Googler's attention and removed needs-info Need information for the developer labels Jun 3, 2021
@schmidt-sebastian
Copy link

Unfortunately, Firestore only logs its network traffic when the log level is explicitly set to debug. Even if you cannot create a minimal repro, a debug log that shows the network traffic would help tremendously.

@Nyankoo
Copy link
Author

Nyankoo commented Jun 4, 2021

@schmidt-sebastian The log level is set to debug in the above logcat file (with FirebaseApp.LogLevel = LogLevel.Debug)

@schmidt-sebastian
Copy link

The log level for Firestore is independent from FirebaseApp. You should see some log messages that show the communication from the WatchStream and the WriteStream.

@Nyankoo
Copy link
Author

Nyankoo commented Jun 4, 2021

@schmidt-sebastian Any guides or pointers how to correctly set this up so I can provide a useful logcat?

@var-const
Copy link

You can use

FirebaseFirestore.LogLevel = LogLevel.Debug;

@Nyankoo
Copy link
Author

Nyankoo commented Jun 5, 2021

@var-const Thank you!

@schmidt-sebastian Please find the logcat with WatchStream and WriteStream below.
62001_logcat.txt

@schmidt-sebastian
Copy link

@Nyankoo This is very helpful and exactly what I need. Thank you.

@schmidt-sebastian
Copy link

@Nyankoo Are you talking to our production backend or to the Emulator?

@Nyankoo
Copy link
Author

Nyankoo commented Jun 11, 2021

@schmidt-sebastian What exactly do you mean?

@schmidt-sebastian
Copy link

Are you using "useEmulator()" in your app and talking to "localhost" instead of "firestore.googleapis.com"?

@Nyankoo
Copy link
Author

Nyankoo commented Jun 11, 2021

@schmidt-sebastian I'm not using any special emulator-related methods.

@Nyankoo
Copy link
Author

Nyankoo commented Jun 12, 2021

We also just had the same crash report through Crashlytics on a Reno Ace with Android 5.1.1, but we can't confirm if this is actually an emulator or real device on the user's end.

@Nyankoo
Copy link
Author

Nyankoo commented Jul 7, 2021

@schmidt-sebastian Any progress with this issue?

@schmidt-sebastian
Copy link

We believe this is invalid data coming from the backend. We have a bug to track this - b/191139962. There are no updates yet.

@cynthiajoan cynthiajoan added blocked-by-dependencies Issues which is blocked by native Android/iOS SDK, backend or third-party dependencies. type: bug and removed needs-attention Need Googler's attention type: question labels Jan 5, 2022
@schmidt-sebastian schmidt-sebastian removed their assignment Apr 14, 2022
@potatoyz
Copy link

potatoyz commented Nov 14, 2023

Hello, has this bug been fixed? We also encountered this problem.

11-14 01:35:05.441 E/AndroidRuntime( 2969): FATAL EXCEPTION: main
11-14 01:35:05.441 E/AndroidRuntime( 2969): Process: , PID: 2969
11-14 01:35:05.441 E/AndroidRuntime( 2969): java.lang.Error: FATAL EXCEPTION [main]
11-14 01:35:05.441 E/AndroidRuntime( 2969): Unity version     : 2020.3.48f1c1
11-14 01:35:05.441 E/AndroidRuntime( 2969): Device model      : Xiaomi MI 5s
11-14 01:35:05.441 E/AndroidRuntime( 2969): Device fingerprint: OnePlus/OnePlus2/OnePlus2:6.0.1/MMB29M/1447841200:user/release-keys
11-14 01:35:05.441 E/AndroidRuntime( 2969): Build Type        : Release
11-14 01:35:05.441 E/AndroidRuntime( 2969): Scripting Backend : IL2CPP
11-14 01:35:05.441 E/AndroidRuntime( 2969): ABI               : x86
11-14 01:35:05.441 E/AndroidRuntime( 2969): Strip Engine Code : true
11-14 01:35:05.441 E/AndroidRuntime( 2969): 
11-14 01:35:05.441 E/AndroidRuntime( 2969): Caused by: java.lang.RuntimeException: Internal error in Cloud Firestore (24.9.1)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.util.AsyncQueue.p(AsyncQueue.java:5)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.util.h.run(lambda)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at android.os.Handler.handleCallback(Handler.java:739)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at android.os.Handler.dispatchMessage(Handler.java:95)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at android.os.Looper.loop(Looper.java:148)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at android.app.ActivityThread.main(ActivityThread.java:5654)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at java.lang.reflect.Method.invoke(Native Method)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:672)
11-14 01:35:05.441 E/AndroidRuntime( 2969): Caused by: java.lang.IllegalArgumentException: Timestamp seconds out of range: 7301194837235273221
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.util.e0.a(Preconditions.java:1)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.Timestamp.validateRange(Timestamp.java:4)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.Timestamp.<init>(Timestamp.java:2)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.remote.o0.w(RemoteSerializer.java:1)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.remote.o0.y(RemoteSerializer.java:3)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.remote.o0.A(RemoteSerializer.java:23)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.remote.x0.y(WatchStream.java:2)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.remote.x0.r(WatchStream.java:1)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.remote.z$c.i(AbstractStream.java:6)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.remote.z$c.j(AbstractStream.java)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.remote.c.run(lambda)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.remote.z$a.a(AbstractStream.java:3)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.remote.z$c.d(AbstractStream.java:1)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.remote.j0$a.c(FirestoreChannel.java:1)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at g.a.s1.z$k.c(DelayedClientCall.java:2)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at g.a.s1.p$d$b.b(ClientCallImpl.java:4)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at g.a.s1.p$d$b.a(ClientCallImpl.java:3)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at g.a.s1.x.run(ContextRunnable.java:2)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at g.a.s1.d2.run(SerializingExecutor.java:3)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at java.util.concurrent.FutureTask.run(FutureTask.java:237)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at com.google.firebase.firestore.util.AsyncQueue$c$b.run(AsyncQueue.java:3)
11-14 01:35:05.441 E/AndroidRuntime( 2969): 	at java.lang.Thread.run(Thread.java:818)
11-14 01:35:05.442 W/ActivityManager(  729):   Force finishing activity com.unity3d.player.UnityPlayerActivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore blocked-by-dependencies Issues which is blocked by native Android/iOS SDK, backend or third-party dependencies. type: bug
Projects
None yet
Development

No branches or pull requests

7 participants