RosettaDrone / rosettadrone

MAVlink and H.264 Video for DJI drones
BSD 3-Clause "New" or "Revised" License
298 stars 114 forks source link

Rosetta crashes because of "Google Maps Android API: Authorization failure" #121

Open kripper opened 1 year ago

kripper commented 1 year ago

After many restarts, Rosetta starts to crash because of a "Google Maps Android API: Authorization failure":

sq.rogue.rosettadrone E/Google Maps Android API: Authorization failure.  Please see https://developers.google.com/maps/documentation/android-api/start for how to correctly set up the map.
sq.rogue.rosettadrone E/Google Maps Android API: In the Google Developer Console (https://console.developers.google.com)
    Ensure that the "Google Maps Android API v2" is enabled.
    Ensure that the following Android Key exists:
sq.rogue.rosettadrone E/AndroidRuntime: FATAL EXCEPTION: GLThread 247
    Process: sq.rogue.rosettadrone, PID: 29522
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.graphics.Bitmap.getWidth()' on a null object reference
        at com.google.maps.api.android.lib6.gmm6.vector.gl.aj.b(:com.google.android.gms.dynamite_mapsdynamite@230514044@23.05.14 (190400-0):2)
        at com.google.maps.api.android.lib6.gmm6.vector.gl.aj.<init>(:com.google.android.gms.dynamite_mapsdynamite@230514044@23.05.14 (190400-0):2)
        at com.google.maps.api.android.lib6.gmm6.vector.gl.g.<init>(:com.google.android.gms.dynamite_mapsdynamite@230514044@23.05.14 (190400-0):18)
        at com.google.maps.api.android.lib6.gmm6.vector.bs.d(:com.google.android.gms.dynamite_mapsdynamite@230514044@23.05.14 (190400-0):14)
        at com.google.maps.api.android.lib6.gmm6.vector.av.run(:com.google.android.gms.dynamite_mapsdynamite@230514044@23.05.14 (190400-0):44)

This kind of random crashes must be addressed urgently because they confuse developers and push them to revert their last changes in despertation to get Rosetta working agian. It happened to me once at the beginning and I lost a lot of time until I had to stop trying to find the cause. Next day it fixed automagically, so I knew something was wrong.

kripper commented 1 year ago

It ocurrs when using "Apply code changes" from Android Studio.

kripper commented 1 year ago

Workaround is to change the GoogleAPI key (to any invalid string), start the app, and then revert to the original key.

Also reported here: https://issuetracker.google.com/issues/201308676