Android Question My widget works when installed with USB crashes when I use B4A Bridge install

Bill Kantz

Member
Licensed User
Longtime User
My widget works when installed with USB crashes when I use B4A Bridge install

This is the exception I get. This is a release not debug build with some Log() statements.

Thanks,
Bill

java.io.IOException: write failed: EIO (I/O error)
at libcore.io.IoBridge.write(IoBridge.java:452)
at java.io.FileOutputStream.write(FileOutputStream.java:187)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:131)
at java.iutputStreamWriter.flushBytes(OutputStreamWriter.java:167)
at java.iutputStreamWriter.convert(OutputStreamWriter.java:181)
at java.iutputStreamWriter.write(OutputStreamWriter.java:266)
at java.io.BufferedWriter.flushInternal(BufferedWriter.java:139)
at java.io.BufferedWriter.close(BufferedWriter.java:91)
at anywheresoftware.b4a.objects.streams.File$TextWriterWrapper.Close(File.java:518)
at anywheresoftware.b4a.samples.homewidgets.widgetservice._parsewxxml(widgetservice.java:281)
at anywheresoftware.b4a.samples.homewidgets.widgetservice._jobdone(widgetservice.java:160)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:174)
at anywheresoftware.b4a.keywords.Common$5.run(Common.java:952)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4456)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)
at dalvik.system.NativeStart.main(Native Method)
Caused by: libcore.io.ErrnoException: write failed: EIO (I/O error)
at libcore.io.Posix.writeBytes(Native Method)
at libcore.io.Posix.write(Posix.java:178)
at libcore.io.BlockGuardOs.write(BlockGuardOs.java:191)
at libcore.io.IoBridge.write(IoBridge.java:447)
... 23 more
 

Bill Kantz

Member
Licensed User
Longtime User
Sub ParseWxXML(Job As HttpJob)
out.Initialize(File.OpenOutput (File.DirRootExternal,"wx.txt",False))
Log("Job Complete")
parser.Parse(Job.GetInputStream, "Parser")
Log("parse complete")
out.Close
End Sub


Sub Parser_StartElement (Uri As String, name As String, Attributes As Attributes)
Dim count As Int
count = Attributes.size - 1
For x = 0 To count
out.Writeline( Attributes.GetName(x))
out.Writeline(Attributes.Getvalue(x))
Next
' For x = 0 To count
' Log(sname(x))
' Log(svalue(x))
' Next
End Sub

Sub Parser_EndElement (Uri As String, name As String, Text As StringBuilder)
out.Writeline(name)
out.WriteLine(Text)
End Sub
 
Upvote 0

Bill Kantz

Member
Licensed User
Longtime User
or is it i forgot:

DIM out as TextWriter

Now i'm not sure how it worked at all? WriteLine() is a member of Textwriter object not File object?
 
Upvote 0

Bill Kantz

Member
Licensed User
Longtime User
Thanks Erel!

The problem was that I did forgot to add "DIM out as TextWriter" to Sub ParseWxXML(Job As HttpJob). Thank for the help I would have chased that one for a while.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…