谷歌地圖V2的黑屏我在Android應用集成谷歌地圖V2。它顯示縮放按鈕和谷歌徽標的空白屏幕。 其保存的實例也是空的。我現在用調試證書籤署了我的應用程序,但是在我用release.store簽署的第一個應用程序中。顯示錯誤之前,如不與谷歌服務器聯繫。當我與
簽名應用debug.store它示出了在ADB響應像Android應用顯示了變焦按鈕和谷歌的標誌
援助= com.google.android。 [email protected]
AIC = NULL
Android清單
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.bilawalkhan.pakistanmap" >
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- The following two permissions are not required to use
Google Maps Android API v2, but are recommended. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".Map"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyCLgSPDsNfVrGFPO2636kWMXIAaZu2f43p"/>
</application>
</manifest>
Main_Activity是
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
// Get a handle to the Map Fragment
GoogleMap map = ((MapFragment) getFragmentManager()
.findFragmentById(R.id.map)).getMap();
LatLng sydney = new LatLng(-33.867, 151.206);
map.setMyLocationEnabled(true);
map.moveCamera(CameraUpdateFactory.newLatLngZoom(sydney, 13));
map.addMarker(new MarkerOptions()
.title("Sydney")
.snippet("The most populous city in Australia.")
.position(sydney));
}
map.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context=".Map">
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
其調試器顯示這樣的。
map = [email protected]
aid = [email protected]c070
>aic = null
logcat中顯示:
10-29 18:40:44.200 3621-3806/com.bilawalkhan.maptesting D/REQUEST﹕ Connection opened to:https://clients4.google.com/glm/mmap/api
10-29 18:40:44.200 3621-3806/com.bilawalkhan.maptesting D/REQUEST﹕ Open Connection
10-29 18:40:45.640 1958-2182/com.bluestacks.gamepophome D/[InMobi]-[Analytics]-4.4.3﹕ Http Status Code: 200
10-29 18:40:45.640 1958-2182/com.bluestacks.gamepophome D/[InMobi]-[Analytics]-4.4.3﹕ IMAppDatabaseManager->deleteEvents
10-29 18:40:45.640 1958-2182/com.bluestacks.gamepophome D/[InMobi]-[Analytics]-4.4.3﹕ Ping Response: {"success":true}
10-29 18:40:45.700 3621-3806/com.bilawalkhan.maptesting D/REQUEST﹕ Processing DataRequest: [email protected]
10-29 18:40:45.720 3621-3806/com.bilawalkhan.maptesting D/REQUEST﹕ Processing DataRequest: [email protected]
10-29 18:40:45.730 3621-3806/com.bilawalkhan.maptesting D/REQUEST﹕ Processing DataRequest: [email protected]
10-29 18:40:45.820 3621-3806/com.bilawalkhan.maptesting D/REQUEST﹕ Processing DataRequest: [email protected]
10-29 18:40:45.820 3621-3795/com.bilawalkhan.maptesting D/USER_EVENTS﹕ Event: type=22, status: fb, data: 1510
10-29 18:40:45.830 3621-3795/com.bilawalkhan.maptesting D/USER_EVENTS﹕ Event: type=22, status: lb, data: 1630
10-29 18:40:45.830 3621-3795/com.bilawalkhan.maptesting D/USER_EVENTS﹕ Event: type=22, status: flbs, data: fb=1510|lb=1630|s=1100
10-29 18:40:45.830 3621-3806/com.bilawalkhan.maptesting D/REQUEST﹕ DRD(0): 62|75|75|147, 1s, 1kb
10-29 18:40:45.830 3621-3806/com.bilawalkhan.maptesting D/REQUEST﹕ Close
10-29 18:41:08.790 1898-2812/com.bluestacks.bstfolder D/dalvikvm﹕ GC_FOR_ALLOC freed 606K, 24% free 2686K/3508K, paused 10ms, total 10ms
10-29 18:41:15.690 1958-2182/com.bluestacks.gamepophome D/[InMobi]-[Analytics]-4.4.3﹕ NetworkManager->handleMessag: msg:{ when=-40ms what=1001 target=android.os.Handler }
10-29 18:41:15.700 1958-2182/com.bluestacks.gamepophome D/[InMobi]-[Analytics]-4.4.3﹕ IMAppDatabaseManager->getEvents
10-29 18:41:15.710 1958-2182/com.bluestacks.gamepophome D/[InMobi]-[Analytics]-4.4.3﹕ PayloadBuilder->getPayloadList:
10-29 18:41:53.870 1898-2812/com.bluestacks.bstfolder D/dalvikvm﹕ GC_FOR_ALLOC freed 606K, 24% free 2678K/3508K, paused 0ms, total 0m
'我整合谷歌地圖一個簡單的API密鑰,但一個V2在我的Android app' ....我太多,和它的作品對我來說... – Selvin 2014-10-29 10:24:20
請閱讀[問]) – mithrop 2014-10-29 10:25:24
但它不適合我 – Bilawal 2014-10-29 10:25:26