skip to Main Content

React native app works fine on Android Studio emulator (using Expo), but when I publish to Play Store and open from there, I cant get past Splash screen (it just closes).

When I ask for feedback, the stack trace says:
RuntimeException API key not found. Check that meta-data android:name="com.google.android.geo.API_KEY"
android:value="your API key" is in the element of AndroidManifest.xml

  1. If the API key isnt right, then why does it run fine on the emulator?
  2. What AndroidManifest.xml should I edit? I have 20 files with that name:
    "…node_modulesreact-native-mapsandroidsrcmainAndroidManifest.xml"
    "…node_modulesreact-nativeReactAndroidsrcandroidTestAndroidManifest.xml" etc

2

Answers


  1. try to add the Api Key on the app.json file:

    For IOS:
    Copy your API key into app.json under the ios.config.googleMapsApiKey field.

    For Android:
    Copy your API Key into your app.json under the android.config.googleMaps.apiKey field.

    Like this:

     "config": {
        "googleMaps": {
          "apiKey": "XXXXXXXXXXXXXX"
        }
      }
    

    for more information you read this:

    https://docs.expo.dev/versions/latest/sdk/map-view/#deploy-app-with-google-maps

    Login or Signup to reply.
  2. If you have used release keystore sha while getting API key then you may face this issue. Play store re-signs the application with its own keys while uploading app to store. In this case you will need to get the sha from play connect and use this sha for API key.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search