Android Question camex2 works fine in debug mode but crashes in release mode

markbarrett_1

Member
Licensed User
Longtime User
Hi,

Trying this out for the first time and I've read up about the problematic issues with LEGAGY mode, which my samsung tab a tablet is. But its strange the first issue appears to be fontawesome, but does that mean it all goes downhill from there? How do I fix that? From the second set of logs, it looks all bad from trying to enumerate cameras etc

Any suggestions or is just go back to camera library for me?

Here is a cut of the log

Logger connected to: samsung SM-T355Y
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.DynamicBuilder.build(DynamicBuilder.java:21)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:349)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at b4a.example3.main._activity_create(main.java:360)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at b4a.example3.main.afterFirstLayout(main.java:102)
at b4a.example3.main.access$000(main.java:17)
at b4a.example3.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Caused by: java.lang.RuntimeException: Font asset not found b4x_fontawesome.otf
at android.graphics.Typeface.createFromAsset(Typeface.java:301)
at anywheresoftware.b4a.objects.TextViewWrapper.getTypeface(TextViewWrapper.java:155)
at anywheresoftware.b4a.objects.TextViewWrapper.build(TextViewWrapper.java:183)
at anywheresoftware.b4a.objects.ButtonWrapper.build(ButtonWrapper.java:98)
... 19 more
main_activity_create (java line: 360)
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (Button).
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at b4a.example3.main._activity_create(main.java:360)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at b4a.example3.main.afterFirstLayout(main.java:102)
at b4a.example3.main.access$000(main.java:17)
at b4a.example3.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Caused by: java.lang.RuntimeException: Object should first be initialized (Button).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(ViewWrapper.java:73)
at anywheresoftware.b4a.objects.ButtonWrapper.innerInitialize(ButtonWrapper.java:39)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:435)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:454)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:148)
... 14 more
Application_Error
(RuntimeException) java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (Button).
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (Button).


But then later in the log goes onto

... 14 more
** Activity (main) Resume **
main_setstate (java line: 1054)
java.lang.RuntimeException: Object should first be initialized (List).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.collections.List.getSize(List.java:129)
at b4a.example3.main._setstate(main.java:1054)
at b4a.example3.main$ResumableSub_OpenCamera.resume(main.java:836)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:240)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Application_Error
(RuntimeException) java.lang.RuntimeException: Object should first be initialized (List).
java.lang.RuntimeException: Object should first be initialized (List).
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:50)
at anywheresoftware.b4a.objects.collections.List.getSize(List.java:129)
at b4a.example3.main._setstate(main.java:1054)
at b4a.example3.main$ResumableSub_OpenCamera.resume(main.java:836)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:240)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:180)
at anywheresoftware.b4a.BA$2.run(BA.java:360)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
** Activity (main) Pause, UserClosed = false **
camex2_stop (java line: 1421)
java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.objects.Camera2.Stop()' on a null object reference
at b4a.example3.camex2._stop(camex2.java:1421)
at b4a.example3.main._activity_pause(main.java:377)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:186)
at b4a.example3.main.onPause(main.java:267)
at android.app.Activity.performPause(Activity.java:7188)
at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1330)
at android.app.ActivityThread.performPauseActivityIfNeeded(ActivityThread.java:4197)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:4174)
at android.app.ActivityThread.performPauseActivity(ActivityThread.java:4148)
at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:4122)
at android.app.ActivityThread.-wrap18(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1671)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)
Application_Error
(NullPointerException) java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.objects.Camera2.Stop()' on a null object reference
 

markbarrett_1

Member
Licensed User
Longtime User
Hi,

I striped out all references to fontawesome and camex2 now works in release mode.

I'll start figuring out what is going on with fontawesome

Cheers.

M
 
Upvote 0

markbarrett_1

Member
Licensed User
Longtime User
Hi,

Just to round this off, I added b4x_fontawesome.otf to the files manager and now it works with the original project.

Cheers.

M
 
Upvote 0
Top