f-miyu / Plugin.CloudFirestore

MIT License
121 stars 44 forks source link

App crashes when there are snapshot listeners active and wifi is turned off #27

Closed guillermo-gerard closed 4 years ago

guillermo-gerard commented 4 years ago

I have an application where I set a couple of snapshot listeners. If the app starts with wifi on, then it appears that the underlying grpc connections trigger a fatal exception when the wifi is turned off. I've tested this removing the listeners and the error no longer occurs. Also, if I start the application with wifi off, then I can turn it on and off and there is no crash.

Stack trace (it is misleading, I spent a lot of time until I found that this was caused by the active listeners):

Fatal Exception: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension; at com.google.common.base.Throwables.getStackTraceAsString(Throwables.java:352) at io.grpc.Status.toString(Status.java:551) at java.lang.String.valueOf(String.java:2896) at java.lang.StringBuilder.append(StringBuilder.java:132) at io.grpc.ConnectivityStateInfo.toString(ConnectivityStateInfo.java:90) at java.lang.String.valueOf(String.java:2896) at java.lang.StringBuilder.append(StringBuilder.java:132) at io.grpc.internal.InternalSubchannel.gotoState(InternalSubchannel.java:325) at io.grpc.internal.InternalSubchannel.scheduleBackoff(InternalSubchannel.java:281) at io.grpc.internal.InternalSubchannel.access$1800(InternalSubchannel.java:62) at io.grpc.internal.InternalSubchannel$TransportListener.transportShutdown(InternalSubchannel.java:601) at io.grpc.okhttp.OkHttpClientTransport.startGoAway(OkHttpClientTransport.java:748) at io.grpc.okhttp.OkHttpClientTransport.onException(OkHttpClientTransport.java:734) at io.grpc.okhttp.OkHttpClientTransport$2.run(OkHttpClientTransport.java:494) at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:764)

guillermo-gerard commented 4 years ago

Just in case anyone else has this same issue, please note that, at least in my case, this was produced by an interaction with another binding I'm using for the pusher android library. Once I've deleted the pusher connection listener off, everything backed to normal