我有一个可行的地图应用程序,但是在我更改了密钥库后,还创建了 api 密钥,并将其更新到我的 AndroidMenifest 中,地图不再显示,
我发现了一些有趣的事情,错误日志中的证书指纹和 api 密钥与我创建的密钥库和控制台 api 密钥完全不同。
我的 api 密钥是 AIzaSyA-XXXXXXXXXXXXXXXXXXXXXJhfQCboM 和 SHA1 是 FE:CF:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:8A:0D
以下是我的清单:
<application
android:allowBackup="true"
android:icon="@drawable/es100x100"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:debuggable="true" >
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyA-XXXXXXXXXXXXXXXXXXXXXXXJhfQCboM" />
<activity
android:name=".MainFragmentActivity"
android:theme="@android:style/Theme.NoTitleBar"
android:windowSoftInputMode="adjustPan"
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
错误日志
Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
Ensure that the following correspond to what is in the API Console: Package Name: esoft.com.edm, API Key: AIzaSyBxxxxxxxxxxxxxxxxxxxxxxxxxx_eSh-E, Certificate Fingerprint: 5BFD72xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxD031
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
希望有人能让我弄清楚我错过了什么......