Android Question How to know which list is the problem [SOLVED]

AHilberink

Well-Known Member
Licensed User
Longtime User
Hi,

Using crashlitics I got the following message:
{"Version":"3.94dg","Error":"java.lang.RuntimeException: Object should first be initialized (List).","Stack":"java.lang.RuntimeException: Object should first be initialized (List).........

What is the easiest way to investigate which list is causing this? I see the name of the sub, but I need to know the list name to check why this happens.

Kind regards,
André
 
Solution
The key lines are:
at ciris.chauffeur.opdrachten._doen(opdrachten.java:1597)
at ciris.chauffeur.opdrachten._btndoen_click(opdrachten.java:860)
They are you original subs.

The relative java file is ciris.chauffeur.opdrachten
In Object/src/ciris/chauffeur/opdrachten.java go to the line number (actual line number in editor).
Just prior to that are comment lines that represent the B4A source file.

Look for calls to doen and btndoen.

(make sure to look at the files that were used to release the version where the error was found)

DonManfred

Expert
Licensed User
Longtime User
What is the easiest way to investigate which list is causing this?
Look at the sull stacktrace in the crashlytics console. There must be more infos, codefile, linenumbers ect. than just this oneliner
 
Upvote 0

AHilberink

Well-Known Member
Licensed User
Longtime User
You don't get the error when you develop? It's only something that your users experience?

This not always happening and not during my development and tests. It has something to do with specific use and I need to know when it happens. That way I can check during development connected to my device.
 
Upvote 0

AHilberink

Well-Known Member
Licensed User
Longtime User
Look at the sull stacktrace in the crashlytics console. There must be more infos, codefile, linenumbers ect. than just this oneliner

I just paste the first line, but this is the whole message:
{"Version":"3.94dg","Error":"java.lang.RuntimeException: Object should first be initialized (List).","Stack":"java.lang.RuntimeException: Object should first be initialized (List).\n\tat anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)\n\tat anywheresoftware.b4a.objects.collections.List.Add(List.java:83)\n\tat ciris.chauffeur.opdrachten._doen(opdrachten.java:1597)\n\tat ciris.chauffeur.opdrachten._btndoen_click(opdrachten.java:860)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)\n\tat anywheresoftware.b4a.BA.raiseEvent2(BA.java:205)\n\tat anywheresoftware.b4a.BA.raiseEvent(BA.java:201)\n\tat anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)\n\tat android.view.View.performClick(View.java:8508)\n\tat android.widget.TextView.performClick(TextView.java:18631)\n\tat android.view.View.performClickInternal(View.java:8485)\n\tat android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)\n\tat android.view.View$PerformClick.run(View.java:33213)\n\tat android.os.Handler.handleCallback(Handler.java:995)\n\tat android.os.Handler.dispatchMessage(Handler.java:103)\n\tat android.os.Looper.loopOnce(Looper.java:273)\n\tat android.os.Looper.loop(Looper.java:363)\n\tat android.app.ActivityThread.main(ActivityThread.java:10060)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:632)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)\n"}
 
Upvote 0

William Lancee

Well-Known Member
Licensed User
Longtime User
The key lines are:
at ciris.chauffeur.opdrachten._doen(opdrachten.java:1597)
at ciris.chauffeur.opdrachten._btndoen_click(opdrachten.java:860)
They are you original subs.

The relative java file is ciris.chauffeur.opdrachten
In Object/src/ciris/chauffeur/opdrachten.java go to the line number (actual line number in editor).
Just prior to that are comment lines that represent the B4A source file.

Look for calls to doen and btndoen.

(make sure to look at the files that were used to release the version where the error was found)
 
Upvote 0
Solution

AHilberink

Well-Known Member
Licensed User
Longtime User
The key lines are:
at ciris.chauffeur.opdrachten._doen(opdrachten.java:1597)
at ciris.chauffeur.opdrachten._btndoen_click(opdrachten.java:860)
They are you original subs.

The relative java file is ciris.chauffeur.opdrachten
In Object/src/ciris/chauffeur/opdrachten.java go to the line number (actual line number in editor).
Just prior to that are comment lines that represent the B4A source file.

Look for calls to doen and btndoen.

(make sure to look at the files that were used to release the version where the error was found)

This:
In Object/src/ciris/chauffeur/opdrachten.java go to the line number (actual line number in editor).
Just prior to that are comment lines that represent the B4A source file.
was the part I was looking for.

Using this I can look on which part of my code needs attention.
 
Upvote 0

AHilberink

Well-Known Member
Licensed User
Longtime User
check opdrachten.java at line 1597
it should give you an further idea.

Otherwise you need to debug more. add a check for the list being initialized, ect.

I found the part. I do a this:
B4X:
            Huidigen.Initialize
            Huidigen=DBUtils.ExecuteList(Main.SQL1,"SELECT Huidige FROM "&Main.DBAanvulling&" WHERE OpdrachtID="&OpdrachtID,Null,0)
            For i=0 To Huidigen.Size - 1

It seems on DBUtils.ExecuteList the Initialize will be gone after no result or something. I think the Huidigen.Size does the crash because of this. I will do more testing.
 
Upvote 0
Top