1

I just got weird error code on Firebase Crashlytics.

Fatal Exception: java.lang.SecurityException
Invalid API Key for package = ***** Status code received = 12
android.os.Parcel.createException (Parcel.java:1950)
android.os.Parcel.readException (Parcel.java:1918)
android.os.Parcel.readException (Parcel.java:1868)
com.google.android.gms.common.internal.IGmsServiceBroker$Stub$zza.getService (IGmsServiceBroker.java:45)
com.google.android.gms.common.internal.BaseGmsClient.connect (BaseGmsClient.java:116)
com.google.android.gms.common.api.internal.zaaq.zaan (zaaq.java:49)
com.google.android.gms.common.api.internal.zaau.run (zaau.java:25)
java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:458)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1167)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:641)
com.google.android.gms.common.util.concurrent.zza.run (zza.java:7)
java.lang.Thread.run (Thread.java:764)

At first look, problem looks-like wrong api key. I checked double api key is correct and the weird side of this problem is it only occur Xiaomi devices (Mi 5s, Mi A1) with Android 9 according to panel. I never encountered this problem on my device (Samsung J7) or any other device. I checked the documentation and nothing found helpful.

Is this about US Sanctions or am I missing something? Is Google Maps not working anymore on Xiaomi devices? Or is it just a bug in map or play-services library?

There is no problem with Google Maps implementation in my app. I just used documentation of Google and it works perfectly. Currently, com.google.android.gms:play-services-maps:17.0.0 and com.google.gms:google-services:4.3.0 are using in project. API KEY defined in Manifest properly. But the error appears in the panel.

PS: I don't know it's relevant but my app used only in Turkey. We can assume that device country is TR.

UPDATE: Now I'm getting new reports and apperantly this error occurs on many devices, not just Xiaomi.

Aykut Uludağ
  • 1,876
  • 5
  • 18
  • 34
  • Is your API key restricted? If so, is it [properly restricted](https://developers.google.com/maps/documentation/android-sdk/get-api-key#restrict_key)? Have you added it to both XML files (for debug and release both)? Can you please post your app-level build.gradle and manifest? – evan Aug 29 '19 at 14:02
  • Also see related https://stackoverflow.com/questions/44862512/google-awareness-api-invalid-api-key-crash – evan Aug 29 '19 at 14:08
  • API key is restricted properly. There is no error or working problem with map. There is no problem in Android devices except Xiaomi devices. Also I checked the error code, it says UNIMPLEMENTED (https://developers.google.com/maps-booking/reference/grpc-api/status_codes). What is the mean of that? P.S: I'm pretty sure that there is no restriction, implementation or key error, because if it is the case, app doesn't work all devices not just Xiaomi – Aykut Uludağ Aug 29 '19 at 14:10

0 Answers0