Android Question de.amberhome.objects.NavigationDrawerWrapper Crash

Multiverse app

Active Member
Licensed User
Longtime User
For quite a while, all our apps have been reporting crashes with this same error stack trace:

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):

1577511841585.png




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 ):
1577514201055.png


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:

1577512604707.png


Crash Video: https://drive.google.com/open?id=1E0ZBCVkOVyRVxqvLjqFAGYt16dHn39IS

1577512629902.png


I've attached full crash logs of this above crash (NavigationDrawerWrapper Crash logs 1.txt and NavigationDrawerWrapper Crash logs 2.txt).
 

Attachments

  • NavigationDrawerWrapper Crash logs 1.txt
    374.9 KB · Views: 663
  • NavigationDrawerWrapper Crash logs 2.txt
    390.4 KB · Views: 860
  • navheaderlayout.bal
    3 KB · Views: 227

Multiverse app

Active Member
Licensed User
Longtime User
B4X:
NavDrawer.Initialize2("NavDrawer", Activity, NavDrawer.DefaultDrawerWidth, NavDrawer.GRAVITY_START) '^ The crash happens on this line.

Is this line 6210?

at com.multiverse.jarvis.main._vvvvvvvvvvvvvvvvvvvvvvvvv3(main.java:6210)

Why aren't you using B4XDrawer?
Just upgraded to b4xdrawer. Everything works fine
 
Upvote 0
Top