我正在尝试在 Android 上使用 Google 地图,但收到以下消息:
I/Google Maps Android API(21300): Failed to contact Google servers. Another attempt will be made when connectivity is established.
E/Google Maps Android API(21300): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
这是我的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.maps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<permission
android:name="com.example.maps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.maps.permission.MAPS_RECEIVE" />
<uses-permission android:name="com.example.maps.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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="android.permission.ACCESS_WIFI_STATE" />
<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.maps.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="AIzaSyAXea0N99Lndg-fFN7y9HupDHvorl3QbDI" />
</application>
</manifest>
我在 Google API 控制台中创建了访问密钥(应用程序使用调试密钥签名,因此我从 Eclipse Preferences->Android->Build->SHA1 指纹中获取了 SHA1 指纹):
并且仅在以下位置
启用:
Google Maps Android API v2
Services
我不知道出了什么问题。有人可以建议我一个解决方案吗?