Sunday, 10 January 2010

Error when Running or Debugging an Android app from Eclipse with your Phone plugged in

As you can probably guess from this post, I've got my self a new phone. It's a T-Mobile G2, otherwise known as an HTC Hero.

I've been dicking around with the SDK and the Eclipse ADT plugin since I got it on Friday.

Today, I've started running into an error where Eclipse says an error occurred when I try to Run or Debug the application on my hardware (not an AVD).

Here is the full error from the Eclipse error log.

null
Error
Sun Jan 10 18:27:37 GMT 2010
An internal error occurred during: "Launching Notepadv2".

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)


So, I started Googling and didn't really find much but I do seem to have sorted it.All I did was close Eclipse, unplug my phone from the USB lead. Reconnect my phone, and fire Eclipse up again.

That seems to do the trick.