Running an Android app in Eclipse raises a NullPointerException

I followed Android, getting started documents , and when I try to start a project, I get:

!MESSAGE An internal error occurred during: "Launching HelloAndroid". !STACK 0 java.lang.NullPointerException at com.android.ide.eclipse.adt.internal.launch.AndroidLaunchController.launch(Unknown Source) 

The application does not start.

+7
android
source share
4 answers

In the top menu, go to "Run", then "Run Configurations" and select the target virtual device. Click Apply, and then run the project.

+26
source share

Disabling my Nexus One and restarting Eclipse fixed the problem. I do not know why.

+2
source share
  • Launch ADV Manager, check if there is an AVD for your Android target, create an ADV for your target (click the "Create ..." button, enter a name, select your target, then click the "Create ADV" button).
  • Launch Eclipse, right-click the name of your Android project in the package explorer window.
  • Select "Properties" or press "Alt + Enter"
  • Click "Run / Debug Settings", then select the project name and click "Edit"
  • Select the Goal tab
  • Click “Automatically” and click the “Update” button (if you have more AVD for the same purpose: check the box that was verified or created by ADV at point 1), then click “Manual value”).
  • Click the Apply button, then the OK button

Now you can run or debug your Android project.

+2
source share

Most likely, you need to remove the existing launcher and recreate it, as described in other answers. You probably did some refactoring or editing the manifest file, and the launch configuration for some reason was not automatically updated. Perhaps because your Eclipse or SDK plugin is deprecated.

0
source share

All Articles