my app runs presently in usb debug mode - no errors and all is fine
when i run it in release mode i get this error and the app crashes
java.lang.Exception: Sub ips_tag_data was not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:219)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
java.lang.Exception: Sub ips_tag_data was not found.
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:219)
at anywheresoftware.b4a.BA$2.run(BA.java:387)
at android.os.Handler.handleCallback(Handler.java:907)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
This tutorial is relevant for B4A and B4J. During compilation B4A generates Java code which is then compiled with the Java compiler and converted to Dalvik (Android byte code format). There are tools that allow decompilation of Dalvik byte code into Java code. The purpose of obfuscation is to...
From the stack trace it looks like an event or maybe CallSubDelayed is trying to invoke a Sub called ips_tag_data. It is being called off the message loop and not directly from your code.
If you look in the b4aTapCard demo project the TapCard object is initialized with the event prefix "ip" and there exists an event Sub called ips_tag_data
B4X:
'this event bring back tagName, the Tag itself (HEX), the Tag length (HEX), and the Tag values (HEX) to the B4A project (from the library)
Sub ips_tag_data (tagname As String, tags As String, taglengths As String, tagvalues As String)
EditText2.Visible = True 'make edittext2 visible
tgname.Add(tagname) 'add a tag name
tg.Add(tags) 'add the tag
tglength.Add(taglengths) 'add the tag length
tgvalue.Add(tagvalues) 'add the tag value
End Sub
I've poked around in the library to try to see where this _tag_data event is raised but I can't find it But it does look like the library may be raising this event in the expectation of there being an matching event Sub.
You should use the original B4A project and work from there "forwards". Most things are there for a reason such as subs that handle events being raised. If you dont include the event subs and the inline Java hooks it will crash.
Dear Johan,
So good to hear from you, indeed I figured it out as I was trying the older code version. Now it works.
I didn't dare to contact you directly as I felt it's on my side.
As said now it works.
But now I have 2 other questions:
1
Can I somehow make it to work only from my app and not to become like as service?
2
Is there a way to dispose the object and run it on demand from my code?
I want basically that the TapCard will work only from my app