For quite a while, all our apps have been reporting crashes with this same error stack trace:
This has brought the stability of all our apps down to 77% (around 770,000 impacted users):
This issue is very similar to the thread here: https://www.b4x.com/android/forum/t...or-in-my-app-any-suggestion-of-solving.85277/
I've written and rewritten the Initialization sub to give the time for the activity to initialize, added sleep(0), the crashes are still reported on every version.
The actual code is no different than than the demo code in the forum.
Same with the designer file, there is very little change to it as well (Attached: navheaderlayout.bal ):
Code:
The major problem is that I cannot replicate this crash on my own device, although I have narrowed down the affected devices in Firebase Test Lab:
Crash Video: https://drive.google.com/open?id=1E0ZBCVkOVyRVxqvLjqFAGYt16dHn39IS
I've attached full crash logs of this above crash (NavigationDrawerWrapper Crash logs 1.txt and NavigationDrawerWrapper Crash logs 2.txt).
B4X:
java.lang.RuntimeException: java.lang.NullPointerException: Attempt to read from field 'de.amberhome.objects.NavigationDrawerWrapper com.multiverse.jarvis.main._vvvvvvvvvvvvvvvvvvvvvvvvv0' on a null object reference
FATAL EXCEPTION: main
Process: com.multiverse.jarvis, PID: 12354
java.lang.RuntimeException: java.lang.NullPointerException: Attempt to read from field 'de.amberhome.objects.NavigationDrawerWrapper com.multiverse.jarvis.main._vvvvvvvvvvvvvvvvvvvvvvvvv0' on a null object reference
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1707)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6718)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.NullPointerException: Attempt to read from field 'de.amberhome.objects.NavigationDrawerWrapper com.multiverse.jarvis.main._vvvvvvvvvvvvvvvvvvvvvvvvv0' on a null object reference
at com.multiverse.jarvis.main._vvvvvvvvvvvvvvvvvvvvvvvvv3(main.java:6210)
at com.multiverse.jarvis.main$ResumableSub_Activity_Create.resume(main.java:572)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1705)
... 7 more
This has brought the stability of all our apps down to 77% (around 770,000 impacted users):
This issue is very similar to the thread here: https://www.b4x.com/android/forum/t...or-in-my-app-any-suggestion-of-solving.85277/
I've written and rewritten the Initialization sub to give the time for the activity to initialize, added sleep(0), the crashes are still reported on every version.
The actual code is no different than than the demo code in the forum.
Same with the designer file, there is very little change to it as well (Attached: navheaderlayout.bal ):
Code:
B4X:
Sub Activity_Create(FirstTime As Boolean)
'Loading the main activity
Activity.LoadLayout("Activity")
'for loading save
LoadSavedData
'Request all the permissions
RequestAllPermissions
'for Material Components
Sleep(0) '<-Added this to let the activity load completely to resolve the crash, although it still occurs
InitializeMaterialComponents '<-Sub for Initializing NavDrawer
'... Other Activity code
End Sub
Sub InitializeMaterialComponents
NavDrawer.Initialize2("NavDrawer", Activity, NavDrawer.DefaultDrawerWidth, NavDrawer.GRAVITY_START)
'^ The crash happens on this line.
NavDrawer.InitDrawerToggle
NavDrawer.NavigationView.LoadLayout("navheaderLayout", NavDrawer.DefaultHeaderHeight)
addNavigationConponents '<Adds Menu items to navdrawer
End Sub
The major problem is that I cannot replicate this crash on my own device, although I have narrowed down the affected devices in Firebase Test Lab:
Crash Video: https://drive.google.com/open?id=1E0ZBCVkOVyRVxqvLjqFAGYt16dHn39IS
I've attached full crash logs of this above crash (NavigationDrawerWrapper Crash logs 1.txt and NavigationDrawerWrapper Crash logs 2.txt).