Android Question java.lang.RuntimeException: Unable to create service

iCAB

Well-Known Member
Licensed User
Longtime User
Hi All

I have been suffering from this problem for the longest while. It only happens with very large projects and only when using the Rapid Debugger. The interesting thing is that it doesn't happen every single time. Sometimes it is ok for a day and other times it is impossible to pass this stage.

Today I tried with the Emulator hoping not to face the same issue, but I am encountering the same problem. This is preventing us from being able to debug the app and causing me tons of headaches, as the only way to debug the app now is by using Legacy Debugger ( which is being depreciated ) and Log Statements all over the code.

We have tried re-installing the tools on 3 different machines from scratch and still facing the issue



B4X:
java.lang.RuntimeException: Unable to create service com.myapp.starter: java.lang.RuntimeException: java.net.SocketException: Socket closed
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3172)
    at android.app.ActivityThread.-wrap5(ActivityThread.java)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1550)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6077)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: java.lang.RuntimeException: java.net.SocketException: Socket closed
    at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:164)
    at anywheresoftware.b4a.shell.Shell.start(Shell.java:102)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:92)
    at com.hidata.traxidriver.starter.onCreate(starter.java:34)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:3162)
    ... 8 more
Caused by: java.net.SocketException: Socket closed
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:120)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:157)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at anywheresoftware.b4a.shell.ShellConnector.sendControlMessage(ShellConnector.java:62)
    at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:124)
    ... 12 more

Please help

Thanks
iCAB
 

iCAB

Well-Known Member
Licensed User
Longtime User
Does it work if you clean the project (Ctrl + P) and remove all breakpoints (Edit - Remove all breakpoints)?
In 99% of the cases it doesn't.

Here is a note that I left myself in the code:

If rapid debugger crashs,
Turn Off & ON Laptop
Turn Off & ON tablet,
and after rebooting the laptop connect Samung TAB E and then open the debugger
Clean project and try again

that seems to help sometimes.
 
Upvote 0

iCAB

Well-Known Member
Licensed User
Longtime User
If it is easy enough to reproduce then you can send me the project and I'll try it here.
Hi Erel

Thanks for the offer. I would have to check with our client first as the product is in production at this stage.
 
Upvote 0
Top