我按照google中的所有步骤操作并获得了API KEY。但我仍然得到这个错误。设备显示空网格视图。
W/System.err(18012): IOException processing: 26
W/System.err(18012): java.io.IOException: Server returned: 3
W/System.err(18012): at
android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(B aseTileRequest.java:115)
W/System.err(18012): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResp onseData(MapService.java:1473)
W/System.err(18012): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.proc essDataRequest(DataRequestDispatcher.java:1117)
W/System.err(18012): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serv iceRequests(DataRequestDispatcher.java:994)
W/System.err(18012): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$Disp atcherServer.run(DataRequestDispatcher.java:1702)
W/System.err(18012): at java.lang.Thread.run(Thread.java:856)
以下是我生成SHA1密钥的方法。
C:\Documents and Settings\user>keytool -list -v -keystore "C:\Documents and
Settings\user\.android\debug.keystore" -alias androiddebugkey -storepass and
roid -keypass android
Alias name: androiddebugkey
Creation date: Aug 20, 2013
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: 1db18033
Valid from: Tue Aug 20 14:50:55 SGT 2013 until: Thu Aug 13 14:50:55 SGT 2043
Certificate fingerprints:
MD5: 85:71:83:F5:CB:82:55:A3:FF:C2:B0:6D:44:5F:95:C4
SHA1: A4:18:42:37:D2:2C:44:D3:01:C8:F4:C4:F2:8E:0A:78:3A:0B:9A:C4
Signature algorithm name: SHA256withRSA
Version: 3
Extensions:
#1: ObjectId: 2.5.29.14 Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
0000: B1 11 13 61 8B 56 27 1C C1 4F 15 B7 4A E0 FB 2C ...a.V'..O..J..,
0010: 47 CD 81 82 G...
]
]
我将密钥添加到下面的AndroidManifest.xml中。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.comp.android.framework.service"
android:versionCode="1"
android:versionName="1.0" >
<permission
android:name="com.comp.android.
framework.service.gis.activty.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.INTERNET" />
<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_MOCK_LOCATION" />
<uses-permission android:name="com.comp.android.framework.service.gis.activty.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="18" />
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:label="LocationTracker"
android:targetPackage="com.comp.android.framework.service" >
</instrumentation>
<application
android:allowBackup="false"
android:icon="@drawable/ic_launcher" >
<uses-library android:name="com.google.android.maps" />
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyC0ysmCRlgo3Y20-yQCTb6qJ-xZ4GZ5LIc"/>
<activity
android:name="com.comp.android.framework.service.gis.activity.AndroidMapActivity"
android:label="@string/title_activity_android_map" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Google API KEY也添加到main.xml中
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView android:id="@+id/mapview"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:enabled="true" android:clickable="true" android:apiKey="AIzaSyC0ysmCRlgo3Y20-yQCTb6qJ-xZ4GZ5LIc" />
</LinearLayout>
我试图在谷歌,但在任何地方,它说API密钥是问题。但我正确地遵循了这些步骤。我看到设备上只有一个网格。我该如何找出问题所在?它甚至没有说谷歌的关键是错误的。它应至少连接到谷歌并应验证密钥。