Michael Chourdakis
Michael Chourdakis

Reputation: 11178

Android Studio project won't run in device

I imported a project from Eclipse to Android studio. In emulator it runs, whereas when there's a device (rooted over WiFi), I get this message in the Event Log:

18:21:55 NumberFormatException: For input string: "": For input string: ""

And then an "internal IDE error".

What could I do before I switch back to Eclipse?

Stack trace:

For input string: "": For input string: ""
java.lang.NumberFormatException: For input string: ""
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    at java.lang.Integer.parseInt(Integer.java:592)
    at java.lang.Integer.parseInt(Integer.java:615)
    at com.android.ddmlib.Device.getDensity(Device.java:1220)
    at org.jetbrains.android.run.AndroidRunningState.getApk(AndroidRunningState.java:1022)
    at org.jetbrains.android.run.AndroidRunningState.doPrepareAndStart(AndroidRunningState.java:915)
    at org.jetbrains.android.run.AndroidRunningState.prepareAndStartApp(AndroidRunningState.java:876)
    at org.jetbrains.android.run.AndroidRunningState.prepareAndStartAppWhenDeviceIsOnline(AndroidRunningState.java:844)
    at org.jetbrains.android.run.AndroidRunningState.doStart(AndroidRunningState.java:678)
    at org.jetbrains.android.run.AndroidRunningState.start(AndroidRunningState.java:654)
    at org.jetbrains.android.run.AndroidRunningState$1.run(AndroidRunningState.java:299)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)
fdfd

Upvotes: 1

Views: 359

Answers (2)

Michael Chourdakis
Michael Chourdakis

Reputation: 11178

In new canary build of Android Studio 1.2, this is fixed.

Best Regards.

Upvotes: 1

GreyBeardedGeek
GreyBeardedGeek

Reputation: 30088

Yes, it looks like Android Studio crashed, not your code.

It sounds like you are running the debugger over wifi? If so, try it with the device plugged into the computer via usb.

I suspect that it has something to do with your 'debug over wifi' configuration - it looks like it's looking for a string containing a number, but getting an empty string. My best guess is that it's the specification of the port number, but could be the ip address..

Upvotes: 0

Related Questions