81

We have an app with some million users. Over the past week we have gotten around 30 "velocity alerts" from Firebase Crashlytics from older versions of the app with error messages like this:

Fatal Exception: java.lang.SecurityException
GoogleCertificatesRslt: not allowed: pkg=com.example.app, sha1=<sha1 redacted>, atk=false, ver=203914019.true (go/gsrlt)
android.os.Parcel.readException (Parcel.java:1959)
android.os.Parcel.readException (Parcel.java:1905)
com.google.android.gms.common.internal.s.r (s.java:37)
com.google.android.gms.common.internal.W.u (W.java:90)
com.google.android.gms.common.api.internal.At.q (At.java:17)
com.google.android.gms.common.api.internal.rt.run (rt.java:5)
java.util.concurrent.Executors$RunnableAdapter.call (Executors.java:457)
java.util.concurrent.FutureTask.run (FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
com.google.android.gms.internal.ef.run (ef.java:6)
java.lang.Thread.run (Thread.java:764)

It isn't impacting that many users, maybe a few hundreds to a thousand. Normally we wouldn't really notice that small a problem, but because it seems to happen over and over again for those users we have gotten all those velocity alerts - making it more apparent.

Why is this happening? The stacktraces varies a bit, but it does look like it's related to Google's GMS.

Is there anything we or our users can do to avoid it?

The issue seem to be spread out among Android versions and device vendors.

Roy Solberg
  • 18,133
  • 12
  • 49
  • 76
  • Same. Thousands of crashes by few hundred users. Mostly Android 9. – Pablo Escobar Oct 05 '20 at 03:00
  • Also 80% crashes are reported in background. Not foreground. – Pablo Escobar Oct 05 '20 at 03:01
  • did anyone found solution to this problem? – Cyph3rCod3r Oct 05 '20 at 03:49
  • For my finding it says Fatal Exception: java.lang.SecurityException: GoogleCertificatesRslt: Package signed with unknown certificate (go/gsrlt). Its happening 100% in Android 9 devices only – Cyph3rCod3r Oct 05 '20 at 03:52
  • From the Firebase Crashlytics report, this crash also occurred on Android 8.0. Does anyone know the reason or the solution? – Elirex Oct 05 '20 at 04:41
  • 8
    Started rising in past 5 days: (1) `GoogleCertificatesRslt: Package signed with unknown certificate (go/gsrlt)` `HE.java` for android 9 (2) `GoogleCertificatesRslt: not allowed` `HT.java` for android 8 (3) `GoogleCertificatesRslt: not allowed` `nK.java` for android 6 – nlmm01 Oct 05 '20 at 05:57
  • Same problem for me, as I can see by my users' events and other threads - the problem could be related to 'WebView' – Vladyslav Matviienko Oct 05 '20 at 06:19
  • In my case it is 75 errors in 9 users for last 5 days. It's not much but it begins to grow. OS Version is mostly 9 and 8.x, various device manufacturers. Almost all exception is after BOOT_COMPLETED receiver complete working (sometimes 1 sec after, sometimes 20 sec). The user didn't even enter the app (only one case is when user open app). – Kenumir Oct 05 '20 at 06:56
  • In my case, I'm getting same error in `HS.java line 194`, ` FM.java line 190 ` and `HE.java line 194`. `HS` and `HE` are appearing on Android 9 devices and `FM` one is appearing on Android 8 devices. – Abhishek Oct 05 '20 at 07:09
  • None of the mentioned solutions worked for me, the chosen answer didn't, and a lot of others didn't too... – FabioR Aug 11 '23 at 18:31

14 Answers14

21

This was an issue in Google Play services as confirmed from someone in dev relations. A fix was rolled out for this on 2nd Oct and we should see a decreasing trend for this as more devices auto update to the latest version(20.39.15).

nlmm01
  • 871
  • 9
  • 12
  • 11
    Hi, nlmm01, I want to know the detail, could you provide any detailed information? (like google issue tracker link). Thank you. – Elirex Oct 05 '20 at 09:08
  • Will try to get more info if possible. – nlmm01 Oct 05 '20 at 11:48
  • Where is the post about this? – android developer Oct 05 '20 at 17:28
  • 1
    I have no official links or docs to point to either, but I also got the same message from a person working nearby this issue. It's a bug in `com.google.android.gms` version `20.39.14` and it's fixed in `20.39.15`. People with that exact version - while awaiting an upgrade - can make the problem go away by upgrading their `WebView` implementation. – Roy Solberg Oct 06 '20 at 12:22
  • @RoySolberg can you share more information releted to this? I didn't used exact version of com.google.android.gms; but still getting this error. How to fix this? Your guidence can save my day!! – Bhoomika Patel Oct 07 '20 at 07:31
  • @BhoomikaPatel: This is the version of the Play Services "app" that the user has on their device. It isn't the version of the library that's included by you in your project. https://play.google.com/store/apps/details?id=com.google.android.gms – Roy Solberg Oct 07 '20 at 08:41
  • Same crash reported for my app. Any information available on Google forums or release notes ? – chetan Oct 07 '20 at 12:29
  • I also had the same issue with my app, mostly happens on os 9 and 8. It's kind of weird that all the issue happens in the first week of this October. Any further information about the problems? I don't see any issue in the past 3 days, could it already be fixed? – bobby I. Oct 08 '20 at 03:02
  • is this being fixed. I recently targeted my app to API 29 and when I try to publish my app update, pre launch report says Package signed with debug key crash on android os 8. – Sai Sunkari Feb 16 '21 at 16:17
  • 2
    but i got error Failed to resolve: com.google.android.gms:play-services-maps:20.39.15 – gumuruh Apr 20 '22 at 05:43
14

If anyone still having this error using play-services-maps using MapView, not fragment implementation, you could try when initialise to add this code:

MapsInitializer.initialize(context, MapsInitializer.Renderer.LATEST, listener)

Google started to progressively update default render since June 2022 and this maybe could crash using MapsInitializer.Render.LEGACY. In my case, it does.

Annoying, but works. More details here.

Cătălin Florescu
  • 5,012
  • 1
  • 25
  • 36
  • 1
    Surprisingly enough this fixes the problem. And it also fixes it for Compose, since under the hood compose is using `AndroidView` with `MapView` – Kuruchy Jan 31 '23 at 11:43
8

Below solution is work for me, Can you try

Added dependancy in 'app/build.gradle' for android

dependencies {
...
implementation 'com.google.android.gms:play-services-maps:18.1.0'
}
Vishal Gadhiya
  • 450
  • 1
  • 6
  • 21
3

If you are trying to run your application for the first time, make sure to turn on android device's Wi-fi.

Maniche
  • 73
  • 7
2

Try to put this before the creation of the MapView object (before the layout be inflated):

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    MapsInitializer.initialize(this, MapsInitializer.Renderer.LATEST) {
        //println(it.name)
    }
    binding = ActivityMainBinding.inflate(layoutInflater)
    setContentView(binding.root)
    ...
}
  • 1
    This is working for me with, thank you Álvaro Santos, using the following line: `MapsInitializer.initialize(this, MapsInitializer.Renderer.LATEST, new OnMapsSdkInitializedCallback() { @Override public void onMapsSdkInitialized(@NonNull MapsInitializer.Renderer renderer) { //println(it.name) Log.d("TAG", "onMapsSdkInitialized: "); } });` – Zonouzi Dec 14 '22 at 15:24
1

The issue tracker link:

https://issuetracker.google.com/issues/228091313

And a Flutter issue

https://github.com/flutter/flutter/issues/109115

norbDEV
  • 4,795
  • 2
  • 37
  • 28
0

Make sure your API_KEY is correctly fetching from your project

<meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="API_KEY" />
0

For those who's getting this error AND the map doesn't load at all, try with a Google Play device, not a Google API device. Worked for me!

Megabit
  • 434
  • 4
  • 10
0

maybe your API KEY does not have the permission like API ROAD or any. you can add it in your credentials/ edit key.

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 03 '23 at 07:39
0

One more case caused by the Google API json key file access permission, you can add these code to the AndroidManifest.xml file for Android:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

and Info.plist file for IOS

<key>NSLocationWhenInUseUsageDescription</key>
<string>Your message goes here</string>
0

Actually I realized that the problem is related to API keys. I was getting the same error in a Flutter project using Firebase.

After running the application with the key on the Google Cloud Console for the solution, I saw a change when I downloaded the google-services.json file in Firebase again. The problem is now fixed for me.

Ali Murat
  • 131
  • 5
0

In my case it was the fragment manager. I was using supportFragmentManager to get the map fragment in my existing fragment. Ex.

val mapFragment: SupportMapFragment? =
            activity.supportFragmentManager
                .findFragmentById(fragmentId) as SupportMapFragment
        

This will work fine for Activity but as I was using this in fragment, it was throwing such "GoogleCertificatesRslt: not allowed" Error.

After researching quite a bit I found the solution. Kindly use below code to get SupportMapFragment if you are using it inside a fragment.

val mapFragment: SupportMapFragment? =  
            fragment.childFragmentManager
                .findFragmentById(fragmentId) as SupportMapFragment
-1

For me i downgrade gradle from:

com.android.tools.build:gradle:7.1.2

to

com.android.tools.build:gradle:4.1.0
MQamhan
  • 1
  • 1
-4

I found in com.google.android.gms:play-services-basement@17.1.0 someting like this:

package com.google.android.gms.common; 

import javax.annotation.Nullable;

@javax.annotation.CheckReturnValue
class zzl { zzl(boolean paramBoolean, @Nullable String paramString, @Nullable Throwable paramThrowable) { this.zzap = paramBoolean;
    this.zzaq = paramString;
    this.cause = paramThrowable; }
  
  static zzl zze() { return zzao; }
  static zzl zza(java.util.concurrent.Callable<String> paramCallable) { return new zzn(paramCallable, null); }
  static zzl zzb(@androidx.annotation.NonNull String paramString) { return new zzl(false, paramString, null); }
  static zzl zza(@androidx.annotation.NonNull String paramString, @androidx.annotation.NonNull Throwable paramThrowable) { return new zzl(false, paramString, paramThrowable); } @Nullable
  String getErrorMessage() { return this.zzaq; }
  final void zzf() { if ((!this.zzap) && (android.util.Log.isLoggable("GoogleCertificatesRslt", 3))) {
      if (this.cause != null) {
        android.util.Log.d("GoogleCertificatesRslt", getErrorMessage(), this.cause);return; }
      android.util.Log.d("GoogleCertificatesRslt", getErrorMessage()); } }
  
  static String zzc(String paramString, zzd paramzzd, boolean paramBoolean1, boolean paramBoolean2) { String str = paramBoolean2 ? "debug cert rejected" : "not whitelisted";
    
    zzd localzzd = paramzzd;{ str, paramString }[2] = 
    

      com.google.android.gms.common.util.Hex.bytesToStringLowercase(com.google.android.gms.common.util.AndroidUtilsLight.zzj("SHA-1").digest(localzzd.getBytes())); Object[] 
      tmp50_28 = tmp28_24;tmp50_28[3] = 
      Boolean.valueOf(paramBoolean1); Object[] tmp57_50 = tmp50_28;tmp57_50[4] = "12451009.false";
    return String.format("%s: pkg=%s, sha1=%s, atk=%s, ver=%s", tmp57_50); }
  private static final zzl zzao = new zzl(true, null, null);
  final boolean zzap;
  private final String zzaq;
  private final Throwable cause;
}

Similar error message.

Kenumir
  • 664
  • 8
  • 24