1

The normal solution to this posted problem is that the SHA1 key is different for the release version and needs to be changed on the google developer console. I updated it and cannot get it to work.

My Google Maps API_KEY currently allows any android application in (the Android applications section is blank), so the SHA1 key is not the issue (to the best of my knowledge). Given that, when I run the app on my phone in debug mode via android studio everything works smoothly. Then, moments later, I generate the signed release and install it via:

adb.exe install [path to apk]

And the maps screen is blank. What is going on? I should be able to use the same Google Maps API key for both debug and release mode as long as they are both listed or all applications are allowed, right?

Ted
  • 51
  • 5
  • did you just try to not to leave the "allowed android application" blank ? – n00dl3 Jun 16 '15 at 07:28
  • I have tried "allowed android application" both blank and listing them out like so: XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:15:A2:DE:05;name0.name1.name2 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:DD:BB:AA:D9;name0.name1.name2 – Ted Jun 16 '15 at 07:34
  • Just now I used Android Studio to "Generate sign APK..." I specified the debug key that the Studio generated by default; I then installed it via adb.exe install. The map was blank again. Is this an inappropriate way to install apps? – Ted Jun 16 '15 at 07:54

3 Answers3

2

The direct cause of the issue is that the debug version of an app can work without the google_maps_key being correct. I had the api_key entered, but incorrectly somehow.

I'm not sure exactly what changes solved the issue, but I deleted some comments and spaces in the google_maps_api.xml. This solved the issue.

<resources>
    <string name="google_maps_key" translatable="false" templateMergeStrategy="preserve">XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</string>
</resources>

For further reading: Google Maps V2 not working in production with correct key

Community
  • 1
  • 1
Ted
  • 51
  • 5
0

try to signin your apk with gradle, and why not keepin the same signin key for debug & release

android {
    signingConfigs {
        release {
            storeFile 'mykeystore.jks'
            storePassword '********'
            keyAlias 'myProject'
            keyPassword '********'
        }
    }

    buildTypes {
        debug {
             signingConfig signingConfigs.release
        }
        release {
              signingConfig signingConfigs.release
        }
    }
}

then execute gradle assembleRelease to generate your signed release apk

  • Sorry, it took me some time to figure out how to do all of this correctly. The outcome: assembleDebug - works! assembleRelease - continues to be blank! – Ted Jun 16 '15 at 11:01
0

If your maps blank after release on Play Store when using restrictions

Add SHA-1 from Google Play Console to your maps API restriction

  1. Open google play console and select your app
  2. Go to setup -> Aplication integrity -> aplication signing
  3. Copy your SHA-1 and add to your maps API restriction