当我运行我的应用程序(谷歌地图应用程序)时,我看不到地图。我只看到一个白色的屏幕(如下图所示)。
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.williamroma.example"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="8" />
<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:name=".GoogleMapActivity"
android:label="@string/app_name" >
<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 -->
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
package com.williamroma.example;
import com.google.android.maps.MapActivity;
import android.app.Activity;
import android.os.Bundle;
public class GoogleMapActivity extends MapActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
这是我看到的屏幕,我希望看到地图就像这个tuotiral http://www.androidhive.info/2012/01/android-working-with-google-maps/
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainlayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<com.google.android.maps.MapView
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="AIzaSyCyk2MVC5Fyl7HIB3iHlPgyRqvOF-VXYJw"
/>
</RelativeLayout>
我在logcat
中收到橙色的这些消息03-31 11:31:16.140: I/Process(1787): Sending signal. PID: 1787 SIG: 9
03-31 11:31:40.940: I/MapActivity(1832): Handling network change notification:CONNECTED
03-31 11:31:40.940: E/MapActivity(1832): Couldn't get connection factory client
03-31 11:31:41.011: D/dalvikvm(1832): GC_CONCURRENT freed 170K, 4% free 9316K/9607K, paused 8ms+6ms
03-31 11:31:41.011: W/CursorWrapperInner(1832): Cursor finalized without prior close()
03-31 11:31:41.011: W/CursorWrapperInner(1832): Cursor finalized without prior close()
03-31 11:31:41.020: D/gralloc_goldfish(1832): Emulator without GPU emulation detected.
03-31 11:31:42.470: W/System.err(1832): IOException processing: 26
03-31 11:31:42.470: W/System.err(1832): java.io.IOException: Server returned: 3
03-31 11:31:42.490: W/System.err(1832): at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
03-31 11:31:42.490: W/System.err(1832): at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
03-31 11:31:42.500: W/System.err(1832): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
03-31 11:31:42.500: W/System.err(1832): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
03-31 11:31:42.520: W/System.err(1832): at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
03-31 11:31:42.520: W/System.err(1832): at java.lang.Thread.run(Thread.java:856)
答案 0 :(得分:2)
通过它看起来你的代码看起来没有Google Map API V1。所以你的密钥一定有问题。据我所知,如果它是一个新生成的密钥,那么Google不会为Google Map API V1提供密钥,因此它必须是Google Map API V2的关键,这就是它没有的原因&# 39;工作。
如果您想将应用程序实现更改为Google Maps API V2,可以使用我编写的本指南以及执行此操作的步骤:
答案 1 :(得分:-1)
我在法律密钥方面遇到了同样的问题。我在3月10日获得了它并且谷歌在3月18日关闭了密钥V1生成器,并告诉V1的应用程序将继续正常运行。所有这一切直到昨天我的应用程序工作很好,但今天我看到一个空白页。