B4J Question OpenCV example run on Debug but crash on Release

inakigarm

Well-Known Member
Licensed User
Longtime User
Hi:

I attach this example for a B4J program with inline java code to use opencv functions https://www.b4x.com/android/forum/threads/inline-javacv-opencv.53963/(thanks to @DrewG)

I can run this program from Debug mode but crash on Release mode with this error:

B4X:
Program started.
main._appstart (java line: 84)
java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4j.object.JavaObject.RunMethod(JavaObject.java:130)
    at b4j.example.main._appstart(main.java:84)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:93)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:84)
    at b4j.example.main.start(main.java:39)
    at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(LauncherImpl.java:863)
    at com.sun.javafx.application.LauncherImpl$$Lambda$53/1578381109.run(Unknown Source)
    at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(PlatformImpl.java:326)
    at com.sun.javafx.application.PlatformImpl$$Lambda$45/1681433494.run(Unknown Source)
    at com.sun.javafx.application.PlatformImpl.lambda$null$170(PlatformImpl.java:295)
    at com.sun.javafx.application.PlatformImpl$$Lambda$48/532978909.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(PlatformImpl.java:294)
    at com.sun.javafx.application.PlatformImpl$$Lambda$46/1685538367.run(Unknown Source)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

No idea why this is running on Debug but not on Release; I've tested other opencv functions and they run also on Debug but not on Release

Any of you have a clue for this error?

Thanks
 

Attachments

  • opencv1.zip
    102.8 KB · Views: 391
Last edited:

inakigarm

Well-Known Member
Licensed User
Longtime User
Thanks @billzhan but tried with no luck; yesterday I wasted two hours trying to run on Release mode, so I'll try another time (or not). The worst thing about it it's that I don't understand at all why works on Debug but no on Release.

It's a shame because there're a lot of classes to filter and process images, face and object recognition and so on (and a lot of documentation elsewhere)

Maybe I could open a Wish Post in B4j forum...
 
Upvote 0
Top