Reputation: 993
Eclipse isn't pointing out any errors in my code. Got an exception when I tried to run the emulator. Here's all my code.
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 file:
<?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 Manifest
<?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>
EDIT Debugging shows the following:
ERROR: the user data image is used by another emulator. aborting
EDIT 2 Console also gives this warning:
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.
EDIT 3 It installs now but the app quits unexpectedly in the emulator.
Upvotes: 2
Views: 1338
Reputation: 57682
Do it step by step:
If this doesn't fix it, remove the app from the emulator and try to start it again.
If that doesn't fix it, you should try to delete the AVD and create a new one...
Upvotes: 1
Reputation: 10948
Close all emulators. Restart Eclipse. Refresh your project. Right click your project, hover on Android Tools and select Fix Project Properties. Look for a blank XML file that you didn't create and delete it if it exists.
One of these things should work.
Upvotes: 1