i created android key. i use the key in my code
<meta-data android:name="com.google.androoid.maps.v2.API_KEY"
android:value="AIzaSyDlSZf-YTqh_rBLyzjzB6VanBVm4xk6VvI"/>
but android can't found api key. i don't know this error cause.
01-15 15:12:33.526: E/AndroidRuntime(28834): Caused by: java.lang.RuntimeException: API key not found. Check that is in the element of AndroidManifest.xml
mannifest file '
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<permission
android:name="com.example.googlemap.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission
android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!--
The following two permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.googlemap.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:value="4030500"
android:name="com.google.android.gms.version"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
<meta-data android:name="com.google.androoid.maps.v2.API_KEY"
android:value="AIzaSyDlSZf-YTqh_rBLyzjzB6VanBVm4xk6VvI"/>
</application>
</manifest>
'
If you see an error message that reads ERROR: Invalid API key during checkout, follow these steps: Go to Wordpress > Printful > Settings. Delete the Printful Store API Key and click Save changes. Go to your Dashboard and click Connect.
API keys have multiple dependencies that can result in errors like: "The user is not authorized for this operation based on …". Please make sure you are using the correct credentials and endpoint with the correct API key.
Go to the Google Maps Platform > Credentials page. On the Credentials page, click Create credentials > API key. The API key created dialog displays your newly created API key. Click Close.
Change this
<meta-data android:name="com.google.androoid.maps.v2.API_KEY"
android:value="AIzaSyDlSZf-YTqh_rBLyzjzB6VanBVm4xk6VvI"/>
// androoid should be android
to
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDlSZf-YTqh_rBLyzjzB6VanBVm4xk6VvI"/>
and remove
<meta-data android:value="4030500"
android:name="com.google.android.gms.version"/>
Also clean and build the project. If it does not work try regenerating the api key again
use these line
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDlSZf-YTqh_rBLyzjzB6VanBVm4xk6VvI"/>
instead of
<meta-data android:value="4030500"
android:name="com.google.android.gms.version"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
<meta-data android:name="com.google.androoid.maps.v2.API_KEY"
android:value="AIzaSyDlSZf-YTqh_rBLyzjzB6VanBVm4xk6VvI"/>
In addition to the answers already given, I had a similar version of this problem and found a solution as follows.
I noticed that for some reason my google_maps_api.xml
file in the values folder had been renamed google_maps_api.xml (w820dp)
. It appeared that in trying to rename the file it still appended the w820dp
. I made a note of my api key and deleted the file entirely, adding a new version, which wasn't appended with w820dp
. This fixed the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With