I have two identical pieces of code in B4A and B4i writing a List object to a random access file via WriteB4XObject
File written with B4A WriteB4XObject is readable with both B4i and B4A ReadB4XObject
File written with B4i WriteB4XObject is readable only with B4i and crashes when attempting to read with B4A
Error occurred on B4A line:
Here is the error log from B4A:
I uploaded two files one created with iOS and one with Android. They both contain the same object (a List in this case).
Androidmade.txt is readable on both OS.
iOSmade.txt is readable only on iOS.
Note that these are not text files, I had to use txt extension to upload files here.
File written with B4A WriteB4XObject is readable with both B4i and B4A ReadB4XObject
File written with B4i WriteB4XObject is readable only with B4i and crashes when attempting to read with B4A
Error occurred on B4A line:
B4X:
129 CurrentFileList=raf.ReadB4XObject(0)
Error occurred on line: 129 (CurrentSession)
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.impromptusports.impromptuhoops.main$_sessionsettings
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readType(B4XSerializator.java:297)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:357)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:246)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:345)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ReadObject(B4XSerializator.java:112)
at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.ReadB4XObject(RandomAccessFile.java:323)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at com.impromptusports.impromptuhoops.currentsession.afterFirstLayout(currentsession.java:102)
at com.impromptusports.impromptuhoops.currentsession.access$000(currentsession.java:17)
at com.impromptusports.impromptuhoops.currentsession$WaitForLayout.run(currentsession.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: com.impromptusports.impromptuhoops.main$_sessionsettings
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at java.lang.Class.forName(Class.java:273)
at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.readTypeClass(RandomAccessFile.java:562)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readType(B4XSerializator.java:274)
... 24 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.impromptusports.impromptuhoops.main$_sessionsettings" on path: DexPathList[[zip file "/data/app/com.impromptusports.impromptuhoops-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 29 more
Suppressed: java.lang.ClassNotFoundException: com.impromptusports.impromptuhoops.main$_sessionsettings
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 30 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
java.lang.RuntimeException: java.lang.ClassNotFoundException: com.impromptusports.impromptuhoops.main$_sessionsettings
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readType(B4XSerializator.java:297)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:357)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readList(B4XSerializator.java:246)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:345)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ReadObject(B4XSerializator.java:112)
at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.ReadB4XObject(RandomAccessFile.java:323)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:710)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:249)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at com.impromptusports.impromptuhoops.currentsession.afterFirstLayout(currentsession.java:102)
at com.impromptusports.impromptuhoops.currentsession.access$000(currentsession.java:17)
at com.impromptusports.impromptuhoops.currentsession$WaitForLayout.run(currentsession.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ClassNotFoundException: com.impromptusports.impromptuhoops.main$_sessionsettings
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:309)
at java.lang.Class.forName(Class.java:273)
at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.readTypeClass(RandomAccessFile.java:562)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readType(B4XSerializator.java:274)
... 24 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.impromptusports.impromptuhoops.main$_sessionsettings" on path: DexPathList[[zip file "/data/app/com.impromptusports.impromptuhoops-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 29 more
Suppressed: java.lang.ClassNotFoundException: com.impromptusports.impromptuhoops.main$_sessionsettings
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 30 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
I uploaded two files one created with iOS and one with Android. They both contain the same object (a List in this case).
Androidmade.txt is readable on both OS.
iOSmade.txt is readable only on iOS.
Note that these are not text files, I had to use txt extension to upload files here.