Ray*_*Lee 4 api-key react-native
I'm trying out React Native Maps but get this when I do react-native run-android:
API key not found. Check that <meta-data android:name="com.google.android.geo.API_KEY" android:value="your API key"/> is in the <application> element of AndroidManifest.xml
Run Code Online (Sandbox Code Playgroud)
My meta-data tag from AndroidManifest.xml:
<meta-data
android:name="com.google.android.geo.maptest"
android:value="A***Q"
/>
Run Code Online (Sandbox Code Playgroud)
I have tried restarting the packager.
Solution: android:name="com.google.android.geo.API_KEY" is literal and shouldn't be changed.
In your AndroidManifest.xml file add the following :-
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="Your Google maps API Key Here"/>
Run Code Online (Sandbox Code Playgroud)
and then run react-native run-android again and you are good to go :)
edit
You can't change the literal "API_KEY" in android:name, Set the android:name as "com.google.android.geo.API_KEY"
| 归档时间: |
|
| 查看次数: |
2692 次 |
| 最近记录: |