Android Question What Does This Mean? java.io.EOFException

Shadow&Max

Active Member
Licensed User
Longtime User
All of a sudden, I'm getting this error... It only happens in debug (rapid) mode but runs perfectly in release mode. I start it up in debug mode, it waits to connect to the debugger, then dies with this. And, it's NOT every time... I just ran it in debug again, and I ran fine. Exited out of the app, started it up again, and once again got the error.. No changes no new data, nuttin'!

java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:159)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:91)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:76)
at com.twodogapps.pts.main.afterFirstLayout(main.java:90)
at com.twodogapps.pts.main.access$100(main.java:16)
at com.twodogapps.pts.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.io.EOFException


at libcore.io.Streams.readFully(Streams.java:83)
at java.io.DataInputStream.readInt(DataInputStream.java:103)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:131)
... 14 more
 

DonManfred

Expert
Licensed User
Longtime User
The rapid debugger used a new style of assets. The Virtual Assets folder.

  • DebuggerForceFullDeployment - Forces the rapid debugger to redeploy the complete project every compilation. This can be useful if you see slow performance after you code changes. It will disable the quick redeployment feature of the rapid debugger.
    Values: True or False.
  • DebuggerForceStandardAssets - Disables the virtual assets feature of the rapid debugger. By default the rapid debugger doesn't use the standard assets folder. This allows the debugger to only redeploy updated files. Values: True or False.
Example
B4X:
#DebuggerForceFullDeployment: true
B4X:
#DebuggerForceStandardAssets: true


The error you posted states a EndOfFileExzeption in the virtual assets...

ava.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.shell.Shell.virtualAssets
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
Hi Manfred... thanks for the reply... DebuggerForceStandardAssets was already in there and true. True or false, still get the error. The other, ForceFullDeployment as true causes the compile to stop dead in the middle.

The error you posted states a EndOfFileExzeption in the virtual assets...

Yes, I know that! Why would I have an EndOfFile exception in assets? There's ample space on the Genymotion emulator, and it always works in release mode. This is something new, that just started yesterday... no new assets were added. Is there a LIMIT on assets?

EndOfFile indicates that it got to the end and then errored, like it's missing an EOF marker or something... I have NO big assets in the app... and I don't have THAT many assets total... there are a lot of ic_action icons etc...
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
Yes, 3.50... now the problem has gone away... don't have a clue why it was there, or why it's gone for now. Seems to run in Debug (rapid) fine now.

What does the error mean Erel?
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
You know Erel... it happened for two days... On and off... And it was mostly with the emulator but happened with the phone as well...

Does it mean that all of the appropriate data didn't get to the device???
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
It's back Erel... And it's annoying as heck... V 3.50, Win 7, Using Genymotion... Moto-X, 4.4.2 API19

1st pass was:
#DebuggerForceStandardAssets: True
#DebuggerForceFullDeployment: True

2nd Pass:
#DebuggerForceStandardAssets: False
#DebuggerForceFullDeployment: True

3rd Pass:
#DebuggerForceStandardAssets: False
#DebuggerForceFullDeployment: False

Here's the log:
java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:159)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:91)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:76)
at com.twodogapps.pts.main.afterFirstLayout(main.java:90)
at com.twodogapps.pts.main.access$100(main.java:16)
at com.twodogapps.pts.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.io.EOFException
at libcore.io.Streams.readFully(Streams.java:83)
at java.io.DataInputStream.readInt(DataInputStream.java:103)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:131)
... 14 more

java.lang.RuntimeException: java.net.SocketException: Socket closed
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:159)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:91)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:76)
at com.twodogapps.pts.main.afterFirstLayout(main.java:90)
at com.twodogapps.pts.main.access$100(main.java:16)
at com.twodogapps.pts.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.net.SocketException: Socket closed
at libcore.io.Posix.sendtoBytes(Native Method)
at libcore.io.Posix.sendto(Posix.java:156)
at libcore.io.BlockGuardOs.sendto(BlockGuardOs.java:177)
at libcore.io.IoBridge.sendto(IoBridge.java:466)
at java.net.PlainSocketImpl.write(PlainSocketImpl.java:507)
at java.net.PlainSocketImpl.access$100(PlainSocketImpl.java:46)
at java.net.PlainSocketImpl$PlainSocketOutputStream.write(PlainSocketImpl.java:269)
at java.io.BufferedOutputStream.flushInternal(BufferedOutputStream.java:185)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:85)
at anywheresoftware.b4a.shell.ShellConnector.sendControlMessage(ShellConnector.java:62)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:119)
... 14 more

java.lang.RuntimeException: java.io.EOFException
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:159)
at anywheresoftware.b4a.shell.Shell.start(Shell.java:91)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:76)
at com.twodogapps.pts.main.afterFirstLayout(main.java:90)
at com.twodogapps.pts.main.access$100(main.java:16)
at com.twodogapps.pts.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.io.EOFException
at libcore.io.Streams.readFully(Streams.java:83)
at java.io.DataInputStream.readInt(DataInputStream.java:103)
at anywheresoftware.b4a.shell.Shell.virtualAssets(Shell.java:131)
... 14 more


These were after 10 previous tries... Release Mode works... Can't work like this... I need to get this resolved, fast...
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
It happens unpredicatably on my phone (Moto-X) with LOTS of memory available. I deleted the old instance and data on the phone, and it failed... on second run, it worked... 3rd run, it didn't.
 
Upvote 0

Sortec

Member
Licensed User
Longtime User
I'm also having the same problem over the past few days. Same project, two different PCs, same tablet with lots of storage. I'm using the rapid debugger, and it seems to do about 6 runs before these problems occur. The compilation then generally fails 8 out of 10 times. I've tried reboots, new cables, restarting B4A, but nothing seems to solve it.
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
I don't believe there's anything wrong with your project. I have the same problem very often.

OK, try this...

If you have breakpoints set, clear them ALL before you hit run, then run it, then, after it's running, set your breakpoints again. This seems consistent for me although Erel says he can't see it.

I can reproduce this every time.

So get rid of all of your breakpoints, and after the run has been started, set them again. I bet that works for you.
 
Last edited:
Upvote 0

Sortec

Member
Licensed User
Longtime User
Yes, exactly the same error. I cleared all of the breakpoints (although I've not set any more yet), and it's run for the first time today. Thanks for the tip! I'll see what happens as I add breakpoints through my debug session....
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
The problem is that you'll have to remove the breakpoints before running every time. Just clearing them and replacing them isn't enough. Each time you run, if you've experienced this issue, you need to clear all breakpoints before you run, and then, when the app's in a waiting state, add them back.
 
Upvote 0

Shadow&Max

Active Member
Licensed User
Longtime User
Timeout maybe... corrupted file, no.

It may be that in a larger project, the breakpoints cause a timing issue, but it's DEFINITELY the breakpoints. You remove them, the app runs. Put them back in, start the app, get error. Remove them, start the app, insert breakpoints again, everything OK until you stop the debugging session, then have to remove them again.
 
Upvote 0

JonRubin

Member
Licensed User
Longtime User
This is happing to me on a regular basis using Legacy Debug. b4a v 3.82 and Bridge V2.09 Sometimes I see the bridge disconnect. When that happens I receive the libcore.ioErrno Exception failed EconnReset... Sometimes it works... Sort of hot then cold. My program is by no means a large one. this will happen regardless of whether breakpoints are set or not... however, I would suspect that it happens more when they are set.....
 
Upvote 0
Top