【发布时间】:2013-09-04 05:27:37
【问题描述】:
我正在尝试将地图添加到我的应用程序,但它根本不起作用...
我已在 google apis 控制台中启用了 android maps api,获得了我的 sha1 指纹,使用以下脚本进行调试和发布:
keytool -list -v -keystore "C:\Users\Amit\AppData\Local\Xamarin\Mono for Android\debug.keystore" -alias androiddebugkey -storepass android -keypass android
和:
keytool -list -v -keystore "D:\Software Projects\xxx.keystore" -alias TasteiTClient -storepass xxx -keypass xxx
使用 sha1 指纹为两者生成密钥
将它们都添加到应用清单中:
<application android:label="TasteIT!" android:theme="@android:style/Theme.Light.NoTitleBar" android:icon="@drawable/appicon">
<!-- <meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="ReleaseKey"/>-->
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="DebugKey" />
</application>
并将地图片段添加到布局中:
<fragment
class="com.google.android.gms.maps.MapFragment"
android:id="@+id/RestaurantsMap"
android:layout_width="match_parent"
android:layout_height="match_parent" />
一旦显示带有地图的布局,我仍然会收到以下错误:
[Google Maps Android API] Failed to contact Google servers. Another attempt will be made when connectivity is established.
[Google Maps Android API] Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
谁能发现我做错了什么?
谢谢
阿米特
【问题讨论】:
标签: google-maps xamarin.android google-maps-android-api-2