API key not found. Check that is in the element of AndroidManifest.xml

FlutterでMap SDK for Androidをテストしようとした。すると。

Unhandled Exception: PlatformException(error, 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, null, java.lang.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 <application> element of AndroidManifest.xml

android/app/source/main/AndroidManifest.xmlにはちゃんと追加してある。

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="****">
    
   <application
        android:label="****"
        android:name="${applicationName}"
        android:icon="@mipmap/ic_launcher">
        
        <meta-data 
        android:name="com.google.android.geo.****" 
        android:value="※※**"/>

API_KEYのとことyour API keyのとこ同じ文字列にしてるんだけどこれ違うのかな?どこで取得すればいいのか全然オシエテクレナイ。

結果

"com.google.android.geo.API_KEY"

の"API_KEY"をアプリのAPI Keyで置き換えてたが、置き換えずにそのまま"com.google.android.geo.API_KEY"でいいらしい。

そりゃそうか。
解決。


この記事が気に入ったらサポートをしてみませんか?