java - Why does my Google Maps Android app not work with my Android App Api Key? -
i going through google maps api key tutorial android , authorization failure error when seek run android app key works when utilize browser app key. manifest xml:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.neatspots" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="10" android:targetsdkversion="17" /> <uses-feature android:glesversion="0x00020000" android:required="true"/> <permission android:name="com.example.neatspots.permission.maps_receive" android:protectionlevel="signature"/> <uses-permission android:name="com.example.neatspots.permission.maps_receive"/> <uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.write_external_storage"/> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices"/> <uses-permission android:name="android.permission.access_coarse_location"/> <uses-permission android:name="android.permission.access_fine_location"/> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.neatspots.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:name="com.google.android.maps.v2.api_key" android:value="..."/> </application> </manifest>
this activity_main.xml file:
<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".mainactivity" > <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:layout_centervertical="true" android:text="@string/hello_world" /> <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.mapfragment"/> </relativelayout>
and main activity:
package com.example.neatspots; import android.os.bundle; import android.app.activity; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } }
this used sha1 fingerprint:
keytool -v -list -alias androiddebugkey -keystore /filepath/debug.keystore -storepass android -keypass android
i don't know problem is!
is app allowed on google console utilize google maps api? bundle defined on manifest must correspond bundle name defined on google api console fingerprint;package-name.
java android google-maps google-maps-api-3
No comments:
Post a Comment