2012-11-14 75 views
-1

任何地图这是我的谷歌地图的关键,我的指纹0o8CRg5BhPmqQB1pvyYZQNfJ2ZbpDMa6XFunRwA的Android地图应用程序没有出现在设备

我把它放在main.xml文件后得到的。应用程序在模拟器上正常工作并显示地图。但是,当我将它部署在真实设备上时,它不会显示任何地图。它只是显示灰色背景而不是任何地图。我该怎么办?

的main.xml文件

<?xml version="1.0" encoding="utf-8"?> 
<com.google.android.maps.MapView 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/mapView" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:clickable="true" 
android:apiKey="0o8CRg5BhPmqQB1pvyYZQNfJ2ZbpDMa6XFunRwA" 
android:enabled="true" 
/> 

清单文件

?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.androidhive.googlemaps" 
android:versionCode="1" 
android:versionName="1.0" > 

<uses-sdk android:minSdkVersion="8" /> 
<uses-permission android:name="android.permission.INTERNET" /> 

<application 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" > 

    <!-- Add Google Map Library --> 
    <uses-library android:name="com.google.android.maps" /> 

    <activity 
     android:label="@string/app_name" 
     android:name=".AndroidGoogleMapsActivity" > 
     <intent-filter > 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
</application> 

<!-- Allow to connect with internet --> 

    </manifest> 
+0

为什么我applicatin不是真实设备 –

+0

显示地图是否在仿真器正常工作:生成调试和这里签名证书API密钥

<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="PUT-KEY-FOR-PRODUCTION-CERT-HERE" /> 

更多信息?你正在使用哪种设备? –

+0

是的,她在我的地图上模拟器工作,但当我在真实设备部署不显示 –

回答

2

你有没有生成密钥都为设备创建APK文件,当您使用调试证书和签名证书。如果您使用密钥作为调试证书,而不是生产签名证书的密钥,则会显示灰色屏幕,并且不显示地图。 https://developers.google.com/maps/documentation/android/mapkey

+0

我得到xml文件中这个地图API密钥0o8CRg5BhPmqQB1pvyYZQNfJ2ZbpDMa6XFunRwA和地点显示在模拟器精细地图,但在真正的手机设备 –

+0

不visibale哪些关键我使用时,项目符号? ? –

+0

您必须有一个密钥存储区,用于在将apk文件上传到设备之前对其进行签名。如果您使用的是eclipse,那么您需要提供密钥库文件的位置,以便在任何设备上运行之前对其进行签名。 – Jer

相关问题