I'm having difficulty identifying a problem in my code. The error only shows up when I am using legacy debug, and probably 90% of the time. The other 10% the problem doesn't show. There is too much code to post the code itself, and some of it is asynchronous - so the messages I have logged that immediately precede the problem are not a good indicator of exactly where the problem is.
The log is as follows:
The app fails at the first "java.lang.RuntimeException. The common item in all the failures is that first line "ArrayIndexOutOfBoundsException: length=90; index=-1" which repeats three times in the log, and appears exactly like that every time I run the app. It looks like a string function indexing problem but I have been unable to identify it.
I don't know if it would help if I could look at the "... 9 more" lines or the "... 10 more lines."
Can anyone tell me how to look at those additional lines?
Does anyone have any insight into the debug messages based on their knowledge of java that might help identify what is the root cause?
How can I relate the line numbers (e.g. "java:965") to the actual line numbers in my code?
Any help would be appreciated ... this is driving me crazy!
The log is as follows:
B4X:
Trying to connect with 192.168.3.46:8080
Connection Successful
astSubscription Incoming Text: HTTP/1.1 200 OK
astSubscription Incoming Text: CONTENT-LENGTH: 0
astSubscription Incoming Text: SERVER: KnOS/3.2 UPnP/1.0 DMP/3.5
astSubscription Incoming Text: SID: uuid:1810bfe0-5f04-1833-a4df-2890685b609c
astSubscription Incoming Text: TIMEOUT: Second-300
astSubscription Incoming Text:
astSubscription Acknowledging HTTP/1.1 200 OK
Content-Length: 0
astSubscription_Terminated; Closing astSubscription & socSubscription
++++++++++++++++++++++++++
Transport State has changed:
NO_MEDIA_PRESENT
++++++++++++++++++++++++++
CurrentURI has changed:
=== Old Value:
=== New Value:
Set Track loaded: false
++++++++++++++++++++++++++
NextURI has changed:
=== Old Value:
=== New Value:
Set NextTrack loaded: false
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: length=90; index=-1
at anywheresoftware.b4a.keywords.Common$5.run(Common.java:965)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4895)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:994)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:761)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: length=90; index=-1
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:213)
at anywheresoftware.b4a.keywords.Common$5.run(Common.java:962)
... 9 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=90; index=-1
at java.util.ArrayList.remove(ArrayList.java:401)
at anywheresoftware.b4a.debug.Debug.PopSubsStack(Debug.java:156)
at b4a.themusicmachine.tmm_flipflop._astevents_newtext(tmm_flipflop.java:214)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:187)
... 10 more
The app fails at the first "java.lang.RuntimeException. The common item in all the failures is that first line "ArrayIndexOutOfBoundsException: length=90; index=-1" which repeats three times in the log, and appears exactly like that every time I run the app. It looks like a string function indexing problem but I have been unable to identify it.
I don't know if it would help if I could look at the "... 9 more" lines or the "... 10 more lines."
Can anyone tell me how to look at those additional lines?
Does anyone have any insight into the debug messages based on their knowledge of java that might help identify what is the root cause?
How can I relate the line numbers (e.g. "java:965") to the actual line numbers in my code?
Any help would be appreciated ... this is driving me crazy!