2012-11-14 120 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

相關問題