android地图活动地图标题没有显示

时间:2011-12-08 06:33:14

标签: android google-maps

我正在关注你好mapview,但我的地图标题是showng,我不知道是什么导致这个问题。

这是我的主要清单xmln

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="cmsc436.finalproj"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INTERNET" />

<application  android:icon="@drawable/ic_launcher"  android:label="@string/app_name" >

      <activity android:name="mymap"></activity>
    <activity android:name="credits"></activity>
    <activity android:name="GameScreen"></activity>
    <activity android:name="pictureSelection"></activity>
    <activity android:name="pictureSelection"></activity>

    <activity android:name="newGameSetUp"></activity>
    <activity android:name="PicturePuzzleActivity">
           <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>

mymap的布局

<?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="0f724slL07SJV93E_oZAPQDt54ewoD-PD7zTmDw"
    />

</RelativeLayot>

我的电脑有两个硬盘,我的代码存储在一个硬盘上,java jdk和eclipse存储在另一个硬盘上,这可能会在这里出现问题吗?

logcat

12-08 01:41:58.128: D/dalvikvm(391): GC_EXTERNAL_ALLOC freed 58K, 50% free 2734K/5379K, external 1625K/2137K, paused 96ms
12-08 01:42:00.479: D/dalvikvm(391): GC_EXTERNAL_ALLOC freed 12K, 49% free 2767K/5379K, external 2225K/2779K, paused 71ms
12-08 01:42:11.248: D/dalvikvm(391): GC_CONCURRENT freed 1094K, 53% free 3209K/6727K, external 3134K/3528K, paused 7ms+4ms
12-08 01:42:11.688: D/dalvikvm(391): GC_CONCURRENT freed 892K, 49% free 3535K/6855K, external 2534K/3164K, paused 7ms+5ms
12-08 01:42:11.898: I/MapActivity(391): Handling network change notification:CONNECTED
12-08 01:42:11.898: E/MapActivity(391): Couldn't get connection factory client
12-08 01:42:12.008: D/dalvikvm(391): GC_EXTERNAL_ALLOC freed 499K, 54% free 3170K/6855K, external 2912K/3164K, paused 53ms
12-08 01:42:12.668: W/System.err(391): IOException processing: 26
12-08 01:42:12.668: W/System.err(391): java.io.IOException: Server returned: 3
12-08 01:42:12.678: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
12-08 01:42:12.678: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
12-08 01:42:12.678: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
12-08 01:42:12.678: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
12-08 01:42:12.678: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
12-08 01:42:12.678: W/System.err(391):  at java.lang.Thread.run(Thread.java:1019)
12-08 01:42:12.970: W/System.err(391): IOException processing: 26
12-08 01:42:12.970: W/System.err(391): java.io.IOException: Server returned: 3
12-08 01:42:12.978: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
12-08 01:42:12.978: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
12-08 01:42:12.978: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
12-08 01:42:12.978: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
12-08 01:42:12.978: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
12-08 01:42:12.988: W/System.err(391):  at java.lang.Thread.run(Thread.java:1019)
12-08 01:42:13.348: W/System.err(391): IOException processing: 26
12-08 01:42:13.348: W/System.err(391): java.io.IOException: Server returned: 3
12-08 01:42:13.348: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
12-08 01:42:13.348: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
12-08 01:42:13.348: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
12-08 01:42:13.348: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
12-08 01:42:13.358: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
12-08 01:42:13.358: W/System.err(391):  at java.lang.Thread.run(Thread.java:1019)
12-08 01:42:13.728: W/System.err(391): IOException processing: 26
12-08 01:42:13.728: W/System.err(391): java.io.IOException: Server returned: 3
12-08 01:42:13.728: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
12-08 01:42:13.728: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
12-08 01:42:13.728: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
12-08 01:42:13.728: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
12-08 01:42:13.740: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
12-08 01:42:13.740: W/System.err(391):  at java.lang.Thread.run(Thread.java:1019)
12-08 01:42:14.098: W/System.err(391): IOException processing: 26
12-08 01:42:14.098: W/System.err(391): java.io.IOException: Server returned: 3
12-08 01:42:14.098: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
12-08 01:42:14.108: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
12-08 01:42:14.108: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
12-08 01:42:14.108: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
12-08 01:42:14.108: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
12-08 01:42:14.108: W/System.err(391):  at java.lang.Thread.run(Thread.java:1019)
12-08 01:42:14.468: W/System.err(391): IOException processing: 26
12-08 01:42:14.468: W/System.err(391): java.io.IOException: Server returned: 3
12-08 01:42:14.468: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
12-08 01:42:14.478: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
12-08 01:42:14.478: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
12-08 01:42:14.478: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
12-08 01:42:14.478: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
12-08 01:42:14.488: W/System.err(391):  at java.lang.Thread.run(Thread.java:1019)
12-08 01:42:14.799: W/System.err(391): IOException processing: 26
12-08 01:42:14.808: W/System.err(391): java.io.IOException: Server returned: 3
12-08 01:42:14.808: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
12-08 01:42:14.808: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
12-08 01:42:14.808: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
12-08 01:42:14.818: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
12-08 01:42:14.818: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
12-08 01:42:14.818: W/System.err(391):  at java.lang.Thread.run(Thread.java:1019)
12-08 01:42:15.208: W/System.err(391): IOException processing: 26
12-08 01:42:15.208: W/System.err(391): java.io.IOException: Server returned: 3
12-08 01:42:15.208: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
12-08 01:42:15.208: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
12-08 01:42:15.218: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
12-08 01:42:15.218: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
12-08 01:42:15.218: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
12-08 01:42:15.218: W/System.err(391):  at java.lang.Thread.run(Thread.java:1019)
12-08 01:42:15.528: W/System.err(391): IOException processing: 26
12-08 01:42:15.528: W/System.err(391): java.io.IOException: Server returned: 3
12-08 01:42:15.538: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
12-08 01:42:15.538: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
12-08 01:42:15.538: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
12-08 01:42:15.538: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
12-08 01:42:15.548: W/System.err(391):  at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
12-08 01:42:15.548: W/System.err(391):  at java.lang.Thread.run(Thread.java:1019)...

2 个答案:

答案 0 :(得分:2)

ApiKey与调试版本不同;发布版本。也许您向网站提供了发布密钥库的指纹? 如果是这样,您还需要为调试密钥库执行此操作。

答案 1 :(得分:0)

我认为你的api密钥有问题...... Google Maps API

我的manifest.xml .....你看到差异吗?

<com.google.android.maps.MapView
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:apiKey="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" />