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.