Android Question App crashes on re-start???

tsteward

Well-Known Member
Licensed User
Longtime User
If I open my app. then back out of it, then re open the app it crashes.
I'm guessing something is not re-initializing maybe.

Is anyone able to make anything out of this crash report that might point me in the right direction?

Please

--------- beginning of crash
--------- beginning of system
--------- beginning of main
~i:*** Service (starter) Create ***
~i:** Service (starter) Start **
~i:** Activity (main) Create, isFirst = true **
~L11131199~-65281:Date 1/12/2020
~l21131205:OK
~l3927983905:Index time: 7 ms (104 Items)
~i:** Activity (main) Resume **
~i:*** Service (httputils2service) Create ***
~i:** Service (httputils2service) Start **
~i:** Activity (main) Pause, UserClosed = true **
~i:** Activity (main) Create, isFirst = false **
~L41131199~-65281:Date 1/12/2020
~l51131205:OK
~e:b4xsearchtemplate_setitems (java line: 339)
~e:java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.objects.collections.Map.Clear()' on a null object reference
~e: at lishi.assistand.tony.stewardgmail.com.b4xsearchtemplate._setitems(b4xsearchtemplate.java:339)
~e: at lishi.assistand.tony.stewardgmail.com.main._loadmanufacturers(main.java:2948)
~e: at lishi.assistand.tony.stewardgmail.com.main._activity_create(main.java:838)
~e: at java.lang.reflect.Method.invoke(Native Method)
~e: at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
~e: at lishi.assistand.tony.stewardgmail.com.main.afterFirstLayout(main.java:105)
~e: at lishi.assistand.tony.stewardgmail.com.main.access$000(main.java:17)
~e: at lishi.assistand.tony.stewardgmail.com.main$WaitForLayout.run(main.java:83)
~e: at android.os.Handler.handleCallback(Handler.java:900)
~e: at android.os.Handler.dispatchMessage(Handler.java:103)
~e: at android.os.Looper.loop(Looper.java:219)
~e: at android.app.ActivityThread.main(ActivityThread.java:8347)
~e: at java.lang.reflect.Method.invoke(Native Method)
~e: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
~e: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
~e:b4xsearchtemplate_setitems (java line: 339)
~e:java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.objects.collections.Map.Clear()' on a null object reference
~e: at lishi.assistand.tony.stewardgmail.com.b4xsearchtemplate._setitems(b4xsearchtemplate.java:339)
~e: at lishi.assistand.tony.stewardgmail.com.main._loadmanufacturers(main.java:2948)
~e: at lishi.assistand.tony.stewardgmail.com.main._activity_create(main.java:838)
~e: at java.lang.reflect.Method.invoke(Native Method)
~e: at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
~e: at lishi.assistand.tony.stewardgmail.com.main.afterFirstLayout(main.java:105)
~e: at lishi.assistand.tony.stewardgmail.com.main.access$000(main.java:17)
~e: at lishi.assistand.tony.stewardgmail.com.main$WaitForLayout.run(main.java:83)
~e: at android.os.Handler.handleCallback(Handler.java:900)
~e: at android.os.Handler.dispatchMessage(Handler.java:103)
~e: at android.os.Looper.loop(Looper.java:219)
~e: at android.app.ActivityThread.main(ActivityThread.java:8347)
~e: at java.lang.reflect.Method.invoke(Native Method)
~e: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
~e: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
~i:*** Service (starter) Create ***
~i:** Service (starter) Start **
~i:** Activity (main) Create, isFirst = true **
~L11131199~-65281:Date 1/12/2020
~l21131205:OK
~l3927983905:Index time: 7 ms (104 Items)
~i:** Activity (main) Resume **
~i:*** Service (httputils2service) Create ***
~i:** Service (httputils2service) Start **
~i:** Activity (main) Pause, UserClosed = false **
~i:** Activity (main) Resume **
~i:** Activity (main) Pause, UserClosed = true **
~i:** Activity (main) Create, isFirst = false **
~L41131199~-65281:Date 1/12/2020
~l51131205:OK
~e:b4xsearchtemplate_setitems (java line: 339)
~e:java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.objects.collections.Map.Clear()' on a null object reference
~e: at lishi.assistand.tony.stewardgmail.com.b4xsearchtemplate._setitems(b4xsearchtemplate.java:339)
~e: at lishi.assistand.tony.stewardgmail.com.main._loadmanufacturers(main.java:2948)
~e: at lishi.assistand.tony.stewardgmail.com.main._activity_create(main.java:838)
~e: at java.lang.reflect.Method.invoke(Native Method)
~e: at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
~e: at lishi.assistand.tony.stewardgmail.com.main.afterFirstLayout(main.java:105)
~e: at lishi.assistand.tony.stewardgmail.com.main.access$000(main.java:17)
~e: at lishi.assistand.tony.stewardgmail.com.main$WaitForLayout.run(main.java:83)
~e: at android.os.Handler.handleCallback(Handler.java:900)
~e: at android.os.Handler.dispatchMessage(Handler.java:103)
~e: at android.os.Looper.loop(Looper.java:219)
~e: at android.app.ActivityThread.main(ActivityThread.java:8347)
~e: at java.lang.reflect.Method.invoke(Native Method)
~e: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
~e: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.objects.collections.Map.Clear()' on a null object reference
at lishi.assistand.tony.stewardgmail.com.b4xsearchtemplate._setitems(b4xsearchtemplate.java:339)
at lishi.assistand.tony.stewardgmail.com.main._loadmanufacturers(main.java:2948)
at lishi.assistand.tony.stewardgmail.com.main._activity_create(main.java:838)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at lishi.assistand.tony.stewardgmail.com.main.afterFirstLayout(main.java:105)
at lishi.assistand.tony.stewardgmail.com.main.access$000(main.java:17)
at lishi.assistand.tony.stewardgmail.com.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:900)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8347)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
 

DonManfred

Expert
Licensed User
Longtime User
Where is your project upload showing the problem?
 
Upvote 0

Sandman

Expert
Licensed User
Longtime User
To me this seems to be the clue:
~e:java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.objects.collections.Map.Clear()' on a null object reference

When you back out of your app, it's not actually quit. So when you return you try to clear a map, but that variable isn't available anymore. Nearby in the log b4xsearchtemplate is mentioned so I'm thinking that's also a clue.

Sorry, I don't have better input, I hope that helps somewhat at least.
 
  • Like
Reactions: eps
Upvote 0

tsteward

Well-Known Member
Licensed User
Longtime User
To me this seems to be the clue:


When you back out of your app, it's not actually quit. So when you return you try to clear a map, but that variable isn't available anymore. Nearby in the log b4xsearchtemplate is mentioned so I'm thinking that's also a clue.

Sorry, I don't have better input, I hope that helps somewhat at least.
Awesome thank you I'll have a look.
Just can't see the forest for the trees :)
 
Upvote 0
Top