Mike
Mike

Reputation: 662

NullPointerException launching Android application

Bit of a strange problem. I opened my eclipse workspace, and tried to launch my android app to test it out, and it throws a NullPointerException launching the app. Not even getting to the app yet.

eclipse.buildId=M20100211-1343
java.version=1.7.0
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86


Error
Sat Nov 12 11:23:25 EST 2011
An internal error occurred during: "Launching ww3".

java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(AndroidLaunchController.java:357)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.doLaunch(LaunchConfigDelegate.java:321)
at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:237)
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)

Edit: Still Nothing. Results of changing the JDK version:

eclipse.buildId=M20100211-1343
java.version=1.6.0_18
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments:  -os win32 -ws win32 -arch x86

Upvotes: 2

Views: 7160

Answers (5)

Scott Warren
Scott Warren

Reputation: 1601

I had a similar problem and none of these suggestions worked.

So I deleted the project (without deleting the files) then remove the .settings and .project and .classpath files from the project.

== Success

Upvotes: 0

Anthony De Souza
Anthony De Souza

Reputation: 554

I had the exact same problem.

The answer below solved it for me after wasting over a day on this madness.

Eclipse launch error when trying to run an Android app

The clue is right at the top of your error trace:

java.lang.NullPointerException at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(AndroidLaunchController.java:357)

Your project is trying to run in a virtual device that doesn't exist any more. It doesn't find it and you are left red-faced like myself. You probably deleted that AVD like I did. (so frustrating the error message isn't clearer!)

All you need to do is relink it to an actual AVD:

The following comment by CharlieMezak worked for me.

  1. right click the eclipse project
  2. click "properties" and look at "run/debug settings
  3. Edit the settings for your project making sure that an existing AVD is checked

Upvotes: 0

brainmurphy1
brainmurphy1

Reputation: 1112

You need to update your ADT. I am not sure exactly how to do that through the menus, as eclipse displayed a dialog directing me to it after I restarted eclipse.

It is worth looking into.

Upvotes: 5

Jimko
Jimko

Reputation: 31

I got this error today too, but on a system that had already been running ok. The difference was I reinstalled dropbox and it resync'd the folder containing my workspace. Finally noticed I had two run configurations, the working one and an old conflicting one dropbox had delivered. The diff between the two run configurations was a checkbox next to the AVD target was unchecked. From the menu: Run > Run Configurations > TargetTab. Checkbox next to your AVD should be checked. Hope it helps.

Upvotes: 2

viktor
viktor

Reputation: 1297

Java 7 is not listed in Android SDK Supported Development Environments yet. Try to use JDK 1.6 instead.

Upvotes: 0

Related Questions