9

I'm trying to set up my workstation for Android development with Eclipse Galileo. I installed the latest ADT plugin and the Android SDK, but I get this error when I try to run any basic Android project I create.

eclipse.buildId=M20090917-0800
java.version=1.6.0_17
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.java.product -product org.eclipse.epp.package.java.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.java.product -data C:\Documents and Settings\dmcnamar\workspace -product org.eclipse.epp.package.java.product


Error
Tue Jan 26 18:00:41 EST 2010
An internal error occurred during: "Launching HelloWorld".

java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(Unknown Source)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.doLaunch(Unknown Source)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(Unknown Source)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:853)
at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:866)
at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1069)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Chillie
  • 1,030
  • 10
  • 28
user259642
  • 103
  • 1
  • 1
  • 5
  • 1
    Did you download any Android platform version after installing the SDK? (by running tools/android) – Bahadır Yağan Jan 26 '10 at 23:33
  • Are you launching this through the emulator or a physical device? – Roman Nurik Jan 27 '10 at 00:50
  • I downloaded a number of Android platform versions from the SDK. When I load Window>Android SDK and AVD manager>Installed Packages in Eclipse, I see them displayed. I was trying to launch the app through an emulator. First I tried an Android 2.0 virtual device and matched its API level to the one in the project. After that didn't work, I tried earlier version emulators and experienced the same error. – user259642 Jan 27 '10 at 14:10
  • 7
    Kamesh Kompella's solution worked for me. However, it took me over an hour to find the checkbox he referred to. It is here: Right click on your project in the Eclipse Package Explorer and choose Properties. Choose Run/Debug settings. Select your project (again) in the list box and then the "Edit" button. Choose the "Target" tab. In my case, "Automatic" was selected, but no preferred AVD. I selected a preferred AVD. Then the program ran! –  Jun 20 '11 at 06:30

6 Answers6

37

In my case, the problem went away when I chose an AVD. I was using an eclipse project and the run configuration had a valid AVD but it was not checked. Once I checked the checkbox, the problem went away.

Regards Kamesh

Kamesh Kompella
  • 386
  • 3
  • 3
  • 12
    That worked for me, too! For others, here's how I did it: right click the eclipse project, click "properties", and look at "run/debug settings." Edit the settings for your project, and under "Target," make sure that an AVD is checked. – CharlieMezak Jan 03 '11 at 22:52
  • Thanks Kamesh.. The problem with me was i had set the run configuration to AVD 3.2 and later on deleted the AVD. When tried running the application changing the run configuration the exception raised. – Jana Mar 14 '12 at 06:00
10

I right-clicked above the manifest.xml file, selected option Run As -> Run Configurations -> on a tab Target, and selected AVD created. I'm using Eclipse Helios for Linux 32b,

Carth
  • 2,303
  • 1
  • 17
  • 26
william
  • 101
  • 1
  • 2
3

I right-clicked above the manifest.xml file, selected option Run As -> Run Configurations -> on a tab Target, and selected AVD created

3

I had this problem myself, confirm that you have a Virtual Device on your AVD. My Error occurred simply because I did not have any Virtual Device.

Another thing to consider is that, If you have your Virtual device, remember to always install the SDK before you start your AVD. I had overlooked this and wasted a lot of time wondering why my AVD is not working. how do you expect your virtual device to work with no OS..

This are just a few problems that beginners will always encounter when starting out...

My advice be keen to detail don't rush into running your Hello World application

kenju254
  • 451
  • 4
  • 6
1

The app worked fine when I pushed it to a physical device, so I figured I'd check the virtual devices some more. From running "adb.exe devices" I see a virtual device in there called ""emulator-5554". When I select this one to run I get the error still, but when I choose "Launch New Virtual Device" I get it to work. When I run "android list avds" it doesn't display the first device, so it looks like a bad device got created somehow causing the error. Thanks for the help!

user259642
  • 103
  • 1
  • 1
  • 5
1

This might already be solved, but in case someone else stumbles on the same issue. I solved it by making a copy of the project, delete it from the workspace and import it back again. Now it all works like a charm. I believe this started after I removed a virtual device from AVD manager.