Android Question EOF, Socket Error, Rapid Debugger failed - 13.4Beta

attune

Member
Upgraded to the 13.4 beta yesterday and using AVD for testing (just more convenient that using my phone, as people keep ringing me)

Frequently getting either a 'timeout', 'EOF', socket or 'Rapid Debugger Failed to connect to process' message.
Keep restarting, cleaning project, starting again, same problem over and over --- and then suddenly it works fine, and it will work fine for maybe an hour or so, then it start again!

Any advice to stop this really appreciated:


Socket error is: (I'll post others when I get them if it helps)


Socket Error::
java.lang.RuntimeException: Unable to create service nsm.com.starter: java.lang.RuntimeException: java.net.SocketException: Socket closed
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:4664)
    at android.app.ActivityThread.-$$Nest$mhandleCreateService(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2264)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:205)
    at android.os.Looper.loop(Looper.java:294)
    at android.app.ActivityThread.main(ActivityThread.java:8177)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)
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:105)
    at nsm.com.starter.onCreate(starter.java:34)
    at android.app.ActivityThread.handleCreateService(ActivityThread.java:4651)
    ... 9 more
Caused by: java.net.SocketException: Socket closed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.socketRead(SocketInputStream.java:118)
    at java.net.SocketInputStream.read(SocketInputStream.java:173)
    at java.net.SocketInputStream.read(SocketInputStream.java:143)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:239)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:279)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:338)
    at java.io.DataInputStream.readFully(DataInputStream.java:203)
    at java.io.DataInputStream.readInt(DataInputStream.java:394)
    at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:136)
    ... 13 more
 

WebQuest

Active Member
Licensed User
Longtime User
🛠️ Recommended Fixes for AVD Debugging Issues


You're seeing errors like timeouts, EOF, socket closed, and “Rapid Debugger Failed to connect to process”? These might help:


  • Toggle ADB Integration
    • Go to Tools > Android and disable “Enable ADB Integration”.
    • Launch the emulator manually.
    • Re-enable ADB Integration and re-run your app.
  • Recreate the Emulator
    • Open Device Manager.
    • Delete your existing AVD.
    • Create a new one with graphics acceleration set to “Software” (especially helpful if you don’t have a dedicated GPU).
  • Update Emulator & SDK Tools
    • Open SDK Manager and ensure the emulator is fully updated.
    • Update system images and build tools as well.
  • Check Network Conflicts
    • Shut down Docker, VirtualBox, or other virtual networks—they sometimes interfere with AVD.
    • In your terminal, run:

  • adb kill-server adb start-server

  • Customize Socket Timeout Handling
    • If you're managing sockets manually, explicitly set a timeout:

    • socket.setSoTimeout(10000); // 10 seconds

    • Add automatic retry logic on SocketTimeoutException.
  • Analyze the Logs

  • Errors like SocketException: Socket closed typically mean the connection was forcefully interrupted.
  • Turn up the logging level to trace what causes the disconnection.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upgraded to the 13.4 beta yesterday and using AVD for testing (just more convenient that using my phone, as people keep ringing me)

Frequently getting either a 'timeout', 'EOF', socket or 'Rapid Debugger Failed to connect to process' message.
Keep restarting, cleaning project, starting again, same problem over and over --- and then suddenly it works fine, and it will work fine for maybe an hour or so, then it start again!

Any advice to stop this really appreciated:


Socket error is: (I'll post others when I get them if it helps)
This error is most probably not related to the new beta. The update doesn't touch anything related.

The Android emulator is very fragile. I recommend using a real device.
 
Upvote 0

attune

Member
Or this:

Failed to connect error:
[IDE message - 5:01:49]
An error occurred.
Rapid Debugger failed to connect to process. Please try to run again.
 
Upvote 0

WebQuest

Active Member
Licensed User
Longtime User
🔍 Common Causes & Fixes
Firewall or Antivirus Blocking Ports
  • Make sure the following ports are open: 8937, 8938, and 59812.
  • Add exceptions in your firewall or antivirus for B4X and Java.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Common Causes & Fixes
Firewall or Antivirus Blocking Ports
  • Make sure the following ports are open: 8937, 8938, and 59812.
  • Add exceptions in your firewall or antivirus for B4X and Java.
🛠️ Recommended Fixes for AVD Debugging Issues


You're seeing errors like timeouts, EOF, socket closed, and “Rapid Debugger Failed to connect to process”? These might help:


  • Toggle ADB Integration
    • Go to Tools > Android and disable “Enable ADB Integration”.
    • Launch the emulator manually.
    • Re-enable ADB Integration and re-run your app.
  • Recreate the Emulator
    • Open Device Manager.
    • Delete your existing AVD.
    • Create a new one with graphics acceleration set to “Software” (especially helpful if you don’t have a dedicated GPU).
  • Update Emulator & SDK Tools
    • Open SDK Manager and ensure the emulator is fully updated.
    • Update system images and build tools as well.
  • Check Network Conflicts
    • Shut down Docker, VirtualBox, or other virtual networks—they sometimes interfere with AVD.
    • In your terminal, run:

  • adb kill-server adb start-server

  • Customize Socket Timeout Handling
    • If you're managing sockets manually, explicitly set a timeout:

    • socket.setSoTimeout(10000); // 10 seconds

    • Add automatic retry logic on SocketTimeoutException.
  • Analyze the Logs

  • Errors like SocketException: Socket closed typically mean the connection was forcefully interrupted.
  • Turn up the logging level to trace what causes the disconnection.
None of this will help. I like ChatGPT but no reason to copy and paste its answers, unless you are sure that it will actually help.
 
Upvote 0

attune

Member
This error is most probably not related to the new beta. The update doesn't touch anything related.

The Android emulator is very fragile. I recommend using a real device.
I knew you'd say that Erel :p:p

However, I've brought a spare phone into the office today, to use B4A bridge, and I'm getting the same issues.
Any way I can find some more deep logging to see whats actually hapening?
 
Upvote 0
Top