simpligility / android-maven-plugin

Maven Plugin for Android Application development and more
http://simpligility.github.io/android-maven-plugin/
Apache License 2.0
1.05k stars 394 forks source link

Debug is not working. #751

Closed zhyi closed 5 years ago

zhyi commented 7 years ago

I'm using android-maven-plugin 4.4.3 with NetBeans. Below is the debug configuration:

<action>
    <actionName>debug</actionName>
    <goals>
        <goal>install</goal>
        <goal>android:deploy</goal>
        <goal>android:run</goal>
    </goals>
    <properties>
        <android.run.debug>${jpda.attach.port}</android.run.debug>
        <jpda.attach>true</jpda.attach>
    </properties>
</action>

After clicking the IDE's debug button, I see that the JPDA connection is reset:

--- android-maven-plugin:4.4.3:run (default-cli) @ my-app ---
android.devicesThreads parameter not set, using a thread for each attached device
android.devices parameter not set, using all attached devices
Device 0123456789ABCDEF_alps_ww808_emmc found.
0123456789ABCDEF_alps_ww808_emmc :   Attempting to start com.zhyi/com.zhyi.AppStart
0123456789ABCDEF_alps_ww808_emmc :   Process 63155 launched
0123456789ABCDEF_alps_ww808_emmc :   Debugger listening on 63155
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 30.335 s
Finished at: 2016-11-27T20:39:39+08:00
Final Memory: 36M/323M
------------------------------------------------------------------------
org.netbeans.api.debugger.jpda.DebuggerStartException: Connection reset
    at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.waitRunning(JPDADebuggerImpl.java:405)
    at org.netbeans.modules.debugger.jpda.JPDADebuggerImpl.waitRunning(JPDADebuggerImpl.java:387)
    at org.netbeans.api.debugger.jpda.JPDADebugger.attach(JPDADebugger.java:324)
    at org.netbeans.modules.maven.debug.DebuggerChecker.executionResult(DebuggerChecker.java:333)
    at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:315)
    at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Caused by: java.net.SocketException: Connection reset
    at java.net.SocketInputStream.read(SocketInputStream.java:209)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at com.sun.tools.jdi.SocketTransportService.handshake(SocketTransportService.java:130)
    at com.sun.tools.jdi.SocketTransportService.attach(SocketTransportService.java:232)
    at com.sun.tools.jdi.GenericAttachingConnector.attach(GenericAttachingConnector.java:116)
    at com.sun.tools.jdi.SocketAttachingConnector.attach(SocketAttachingConnector.java:90)
    at org.netbeans.api.debugger.jpda.AttachingDICookie.getVirtualMachine(AttachingDICookie.java:231)
    at org.netbeans.modules.debugger.jpda.actions.StartActionProvider.doStartDebugger(StartActionProvider.java:188)
    at org.netbeans.modules.debugger.jpda.actions.StartActionProvider.access$200(StartActionProvider.java:80)
    at org.netbeans.modules.debugger.jpda.actions.StartActionProvider$1.run(StartActionProvider.java:165)
    at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
    at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
    at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
    at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)

However, I'm able to attach the debugger by manually forwarding the process to a local port with adb.

mosabua commented 5 years ago

Trying to get this currently fixed with the upcoming 4.6 release