我已經生成了API密鑰,但總是得到授權失敗,儘管密鑰是正確的。我爲此添加了所需的所有許可,但仍然無法使用;谷歌地圖V2授權失敗
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xxx.boutique"
android:versionCode="1"
android:versionName="1.0" >
<permission
android:name="com.xxx.boutique.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.xxx.boutique.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Required to show current location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required OpenGL ES 2.0. for Maps V2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.xxx.boutique.Page_acc"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.xxx.boutique.Catalogue"
android:label="@string/title_activity_catalogue" >
</activity>
<activity
android:name="com.isims.boutique.Contact"
android:label="@string/title_activity_contact" >
</activity>
<activity
android:name="com.isims.boutique.Map"
android:label="@string/title_activity_map" >
</activity>
<activity
android:name="com.isims.boutique.Apropo"
android:label="@string/title_activity_apropo" >
</activity>
<activity
android:name="com.xxx.boutique.Tabmsg"
android:label="@string/title_activity_tabmsg" >
</activity>
<activity
android:name="com.xxx.boutique.Tabrdv"
android:label="@string/title_activity_tabrdv" >
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="API KEY" />
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
,這就是我在logcat中,同樣的錯誤每次都獲得:
E/Google Maps Android API(2382): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
清理和重建項目...在卸載應用程序之前,從測試deice –
重新安裝後它工作正常。謝謝 –
樂意幫忙:) –