Android Question Okhttp outOfBoundsError

Olli73

Member
Licensed User
Longtime User
Hallo!
After updating an existing code with b4a 9.90 it seems that Job.release from okhttp V 1.2 raise an outofbounds error in Java sometimes. I got this error only on an older device with Android 5.1. Under Android 10 everythink seems to work without errors.
Is there a newer Version of okhhtp or can I fix this error?
 

DonManfred

Expert
Licensed User
Longtime User
I don´t see how a httpjob could raise an outofbounds exception.
Where is the full error?

Please upload a small project which shows the problem.
 
Last edited:
Upvote 0

Olli73

Member
Licensed User
Longtime User
I got the following error description and it happens in a try catch block. The error occurs sometimes but not everytime.... so till now I wasn`t able to catch the error in the debugger....


Here is the error description:

updaternachrichten$ResumableSub_Updatebedarfresume (B4A line: 882)
Log(LastException)
java.lang.IndexOutOfBoundsException: index 27
at java.util.concurrent.atomic.AtomicIntegerArray.checkedByteOffset(AtomicIntegerArray.java:35)
at java.util.concurrent.atomic.AtomicIntegerArray.get(AtomicIntegerArray.java:82)
at anywheresoftware.b4a.debug.Debug.ShouldStop(Debug.java:234)
at ostseecamp.Campmessanger.updaternachrichten$ResumableSub_Updatebedarf.resume(updaternachrichten.java:7415)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:267)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:207)
at anywheresoftware.b4a.keywords.Common$11.run(Common.java:1178)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5938)
at java.lang.reflect.Method.invoke(Native Method)



And here is the code:

B4X:
Dim job1 As HttpJob
job1.Initialize("Job12", Me)
job1.Download(URL)
Wait For (job1) JobDone(job1 As HttpJob)
If job1.Success Then
        Updatebedarf_auswerten(job1)
End If
Try
        job1.Release
Catch
        Log(LastException)
        Log("Fehler Updatebedarf abfragen")
        NaAbfrage = False
        
        Try
            Abfragen_fertig
        Catch
            Log("Fehler Updatebedarf in Abfragen_fertig")
        End Try
        
End Try
 
Upvote 0
Top