I couldn't find just a 'wear' channel so trying he...
# compose-wear
a
I couldn't find just a 'wear' channel so trying here, is there a way to catch exceptions like this from within the wear communication layer? This is the top crash in our watch app that seems to have started/spiked about a month ago:
Copy code
Exception e4.b: 20: The connection to Google Play services was lost due to service disconnection.
  at com.google.android.gms.common.internal.ApiExceptionUtil.fromStatus (ApiExceptionUtil.java)
  at com.google.android.gms.common.internal.zap.zaa (zap.java)
  at com.google.android.gms.common.internal.zar.onComplete (zar.java)
  at com.google.android.gms.common.api.internal.BasePendingResult.zab (BasePendingResult.java)
  at com.google.android.gms.common.api.internal.BasePendingResult.setResult (BasePendingResult.java)
  at com.google.android.gms.common.api.internal.BasePendingResult.forceFailureUnlessReady (BasePendingResult.java)
  at com.google.android.gms.common.api.internal.zav.zaa (zav.java)
  at com.google.android.gms.common.api.internal.zav.zaa (zav.java)
  at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.zaa (GoogleApiManager.java)
  at com.google.android.gms.common.api.internal.GoogleApiManager$zaa.onConnectionSuspended (GoogleApiManager.java)
  at com.google.android.gms.common.internal.zag.onConnectionSuspended (zag.java)
  at com.google.android.gms.common.internal.BaseGmsClient$zzb.handleMessage (BaseGmsClient.java)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:246)
  at android.os.HandlerThread.run (HandlerThread.java:67)
This exception also started around the same time:
Copy code
Exception e4.b: 17: API: Wearable.API is not available on this device. Connection failed with: a{statusCode=API_UNAVAILABLE, resolution=null, message=null}
y
Do you mean it's thrown internally (where you can't possibly catch it) and hitting some uncaught exception handlers and crashing your App? Or are you just not expecting it in some call you are making?
a
that callstack doesn't have my app code at all, so it doesn't seem like I can catch it, unless I'm misunderstanding this and I am actually missing a try catch around some call i'm making to send messages to mobile. (I am publishing a change to do that soon as a guess, found a couple places missing that)
y
That very well can be true. But it's quite possible that all the exceptions look like that because of Guava ListenableFuture Task. Async code is notoriously hard to follow through stacktraces.
a
Yeah maybe that will help. Its also surprising to me to have grown so much a month ago, when we didn't make any changes in the past 6 months, so maybe some play services upgrade outside my app is involved (or requirement to be on a newer version of play-services-wearable)
y
I'd encourage raising a bug anyway, a bug report might help the underlying cause.
a
We released an update that put try catches around all the API usage but still getting the exception. I also see this new thing in the play store console, but nothing is clickable for me to find the documentation on how to avoid it:
I guess I never posted the issue I created before too, here it is: https://issuetracker.google.com/issues/257765160