2011-12-21 75 views
1

我試圖在mapview中加載谷歌地圖。我已經在main.xml中插入了google API密鑰。插入API密鑰後未加載Android谷歌地圖

這是我的清單文件:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="My.google.mao" 
android:versionCode="1" 
android:versionName="1.0" > 
<uses-permission android:name="android.permission.INTERNET" /> 

<uses-sdk android:minSdkVersion="7" /> 

<application 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" > 
    <activity 
     android:name=".GmapActivity" 
     android:theme="@android:style/Theme.NoTitleBar" 
     android:label="@string/app_name" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <uses-library android:name="com.google.android.maps" /> 
</application> 

</manifest> 

這是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="Api key"/> 

//Api key has been inserted 

只箱子被加載在圖形頁面,任何人都可以解決我的問題?

回答

1

最有可能的原因是混合調試密鑰和釋放密鑰,因爲簽名是不同的密鑰是不同的,你需要得到兩者。有上programaticaly selecting the right key

+0

有可能,但如何才能I S我的prooblem會有人幫助我嗎? – 2011-12-21 18:47:25

0

這問題就來了2種情形 給這些用途的任何權限也ACCES核心位置後,訪問精確的位置

還有一件事是你AR enot給出正確的API密鑰,以便生成正確TRYAGAIN,

該API密鑰將在您的系統只工作

如果您有與生成API密鑰的任何問題,我會幫你