Android Question java.lang.Exception: Sub astream_newdata signature does not match expected signature

javiito

Member
Licensed User
Hi,

I have attached a "USB to serial" device to my mini-pc. The UsbSerial and AsyncStreams objects that control the data flow run in a service.

In Release mode, when some data comes from the serial port, the main process suddenly closes with the following error:

java.lang.Exception: Sub astream_newdata signature does not match expected signature.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:189)
at anywheresoftware.b4a.BA$3.run(BA.java:334)
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)
Shutting down VM
threadid=1: thread exiting with uncaught exception (group=0x41784ba8)
java.lang.RuntimeException: java.lang.Exception: Sub astream_newdata signature does not match expected signature.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA$3.run(BA.java:334)
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.lang.Exception: Sub astream_newdata signature does not match expected signature.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:189)
... 10 more
FATAL EXCEPTION: main
Process: domotica.server2, PID: 5882
java.lang.RuntimeException: java.lang.Exception: Sub astream_newdata signature does not match expected signature.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.BA$3.run(BA.java:334)
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.lang.Exception: Sub astream_newdata signature does not match expected signature.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:189)
... 10 more
Force finishing activity domotica.server2/.main


In debug-rapid mode it works.

I have closed all services related to the application and manually uninstalled the app but the application still does not work in release mode. I have changed the package name and the version with no luck.

Any advice?

Thanks.
 

javiito

Member
Licensed User
Hi,

I finally discover the error by myself: in the "AStream_NewData" definition I had
B4X:
Sub AStream_NewData (BufferIn() As Int)
instead of
B4X:
Sub AStream_NewData (BufferIn() As Byte)
The funny thing is that it always worked in debug mode and worked in previous versions of USBSerial library.

Thanks!
 
Top