當我運行我的應用程序有來自Eclispe的一個谷歌地圖,地圖上顯示出來,所有的地圖功能的工作..與谷歌地圖API密鑰奇怪的錯誤
但是,如果我與朋友分享我的Eclipse項目或者將我的應用導出爲APK並將其重新安裝到設備上,地圖不會顯示出來。它說:
02-07 00:26:39.644: E/Google Maps Android API(3605): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
我不知道是什麼造成這種情況。特別是因爲當我(從控制檯獲取APK並將所有內容設置爲SHA1)從Eclipse運行時,它能正常工作嗎?
這是我與地圖碎片
<android.support.v4.widget.DrawerLayout ...... >
<LinearLayout ... >
<RelativeLayout ..>
<Button ... > </Button>
<EditText .. > </EditText>
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="20"
class="com.google.android.gms.maps.SupportMapFragment" />
</LinearLayout>
<ListView android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/transparent"
android:dividerHeight="0dp"
android:background="#111"/>
</android.support.v4.widget.DrawerLayout>
你使用清單發佈API密鑰。 – Yugesh
嗨讀完你的問題後,我想爲生成地圖鍵,你用你的android-debug-key,是嗎? –
生成另一個API密鑰並嘗試。 –