Eclipse沒有指出我的代碼中有任何錯誤。當我嘗試運行模擬器時出現異常。這是我所有的代碼。Android InstallException:EOF Google MapsView「Hello Maps」
HelloGoogleMaps.java
package com.example.hellogooglemaps;
import android.app.Activity;
import android.os.Bundle;
import com.google.android.maps.*;
import android.widget.LinearLayout;
import android.widget.ZoomControls;
public class HelloGoogleMaps extends MapActivity
{
LinearLayout linearLayout;
MapView mapView;
ZoomControls mZoom;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
@Override
protected boolean isRouteDisplayed() {
return false;
}
}
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="my_api_key" //I have this in my program. Just not putting it in post.
/>
HelloGoogleMaps艙單
<?xml version="1.0" encoding="utf-8"?>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".HelloGoogleMaps"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
編輯調試顯示以下內容:
ERROR: the user data image is used by another emulator. aborting
EDIT 2控制檯也給出了這樣的警告:
Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
編輯3它現在安裝,但應用程序意外退出模擬器。
沒有工作。我沒有在eclipse左邊的目錄中看到一個空白的XML文件。 「無法在設備'emulator-5556上安裝HelloGoogleMaps.apk!(null)」 – STANGMMX 2011-04-29 22:21:40
此空白XML文件在哪裏?也許我在看錯地方。 – STANGMMX 2011-04-29 22:42:20
另外,我正在運行Mac OSX。不知道這是否會有所作爲。 – STANGMMX 2011-04-29 22:42:36