Bug? error converbytestoobjet

Status
Not open for further replies.

jesuslizonsoluciones

Member
Licensed User
Longtime User
good morning


when executing the ser.ConvertBytesToObject (data) line


I get the following error:


java.lang.RuntimeException: java.lang.ClassNotFoundException: QuickMovil.OCRComplete.main$_mymessage
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readType(B4XSerializator.java:297)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readObject(B4XSerializator.java:357)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ReadObject(B4XSerializator.java:112)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.ConvertBytesToObject(B4XSerializator.java:82)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at QuickMovil.OCRComplete.checkinfirma._newdata(checkinfirma.java:3403)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.debug.Debug.CallSub4(Debug.java:318)
at anywheresoftware.b4a.debug.Debug.CallSubNew2(Debug.java:285)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:1056)
at QuickMovil.OCRComplete.comunicaciones._astream_newdata(comunicaciones.java:199)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at anywheresoftware.b4a.BA$2.run(BA.java:370)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
Caused by: java.lang.ClassNotFoundException: QuickMovil.OCRComplete.main$_mymessage
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:453)
at java.lang.Class.forName(Class.java:378)
at anywheresoftware.b4a.randomaccessfile.RandomAccessFile.readTypeClass(RandomAccessFile.java:562)
at anywheresoftware.b4a.randomaccessfile.B4XSerializator.readType(B4XSerializator.java:274)
... 32 more
Caused by: java.lang.ClassNotFoundException: Didn't find class "QuickMovil.OCRComplete.main$_mymessage" on path: DexPathList[[zip file "/data/app/QuickMovil.OCRComplete-KwoEk53fzRVJBhaG6TctcQ==/base.apk"],nativeLibraryDirectories=[/data/app/QuickMovil.OCRComplete-KwoEk53fzRVJBhaG6TctcQ==/lib/arm64, /data/app/QuickMovil.OCRComplete-KwoEk53fzRVJBhaG6TctcQ==/base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64, /product/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)






B4X:
public Sub NewData (data() As Byte)    '*********************************llega la trama
   
   
    Private ser As B4XSerializator
   
   
   
    Log ("llagada de datos")
   
    Dim edtAge As String, edtName As String
   
   
    Dim mm As MyMessage = ser.ConvertBytesToObject(data)
'    edtAge = mm.Age
'    edtName = mm.Name
    'convert the array of bytes to image
    Dim in As InputStream
    in.InitializeFromBytesArray(mm.Image, 0, mm.Image.Length)
    Dim bmp As Bitmap
    bmp.Initialize2(in)
    'draw the image
    Dim dest As Rect
 

DonManfred

Expert
Licensed User
Longtime User
did you define the Type MyMessage in your Main class?
 
Status
Not open for further replies.
Top