Android Question help: crash in release - OK in debug

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
hi,

me again...

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)

any ideas ?
thanks
 
Upvote 0
Thanks but that would be very problematic, the code is huge (many thousands of lines)
I'm trying to implement Johan's TapCard library.

In debug it works fine
Only in release I get the error
 
Upvote 0
Yes, tried them both

BTW - what's the difference and which is recommended to use and to upload to google play store?
 
Upvote 0
Forum search still works quite well
 
Upvote 0
Thanks
But I don't have such a sub in my code (maybe Johan has one in his code)

How do you explain the fact that it doesn't happen in debug mode?
 
Upvote 0
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: Copy
'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.
 
Upvote 0
Thanks
I'll drill this down and revert, maybe I missed something... ?

But how can we explain the fact that in debug mode is works with no errors, only in release mode?
 
Upvote 0
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.
 
Upvote 0
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

Hope you're doing well these days...
Cheers
 
Upvote 0
Back
Top