Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayIndexOutOfBoundsException on call instance. #1506

Ncl8 opened this issue Jan 21, 2016 · 13 comments

ArrayIndexOutOfBoundsException on call instance. #1506

Ncl8 opened this issue Jan 21, 2016 · 13 comments


Copy link

@Ncl8 Ncl8 commented Jan 21, 2016

I started to get this error message after upgrading to retrofit:2.0.0-beta3. Not sure if that's the culprit or what since reverting to previous version doesn't seem to make a difference. Just in case the fault was in my retrofit code, i copied the sample code and ran it with the same result.

I only get it on marshmallow devices.

Line 94 refers to Call<List> call = github.contributors("square", "retrofit");

That line is called inside an GenericAsyncTaskLoader (

Calling it in a normal AsyncTask doesn't produce an error.

A/art: art/runtime/] Throwing new exception 'length=176; index=1283' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=176; index=1283
A/art: art/runtime/]   at void$Result) (
A/art: art/runtime/]   at$Result (
A/art: art/runtime/]   at java.lang.Object (
A/art: art/runtime/]   at java.lang.Object (
A/art: art/runtime/]   at java.lang.Object$LoadTask.doInBackground(java.lang.Void[]) (
A/art: art/runtime/]   at java.lang.Object$LoadTask.doInBackground(java.lang.Object[]) (
A/art: art/runtime/]   at java.lang.Object$ (
A/art: art/runtime/]   at void (
A/art: art/runtime/]   at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (
A/art: art/runtime/]   at void java.util.concurrent.ThreadPoolExecutor$ (
A/art: art/runtime/]   at void (
Copy link

@JakeWharton JakeWharton commented Jan 21, 2016

This is a bug in the Android Gradle plugin 2.0.0-alpha6. Reverting to alpha3 will fix it. See #1486 for more info and a link to the bug filed on

Copy link

@lemadane lemadane commented Aug 9, 2016

I encountered this issue, when I am using Mars-mallow. I do not have an issue using Lollipop. I disabled the Instant Run from Android Studio and the problem is gone.

Copy link

@iaubain iaubain commented Oct 10, 2016

Guys, this issue does have any relation with Retrofit I think.
For me I had same issue but what was causing this was the erroneous processes inside onResponse

public void onResponse(Call call, Response response) {
//Error was happening inside here
//I was calling an other Object instance and passing them wrong parameters

Still my instant code running is enabled and everything is as by default.

Hope this will help someone.
a funny thing is that, its my first time to comment on something on Github.... Jejejejeje
Happy coding Day

Copy link

@green130181 green130181 commented May 2, 2017

I also have this issue
pid: 17023, tid: 17107, name: Thread-4 >>> <<<
signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
Abort message: 'art/runtime/] Throwing new exception 'length=3260; index=56452' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=3260; index=7360'
x0 0000000000000000 x1 00000000000042d3 x2 0000000000000006 x3 0000000000000008
x4 0000000000000113 x5 0000000000000000 x6 0000000000000000 x7 feff666e6b61686b
x8 0000000000000083 x9 ffffffffffffffdf x10 0000000000000000 x11 0000000000000001
x12 ffffffffffffffff x13 ffffffffffffffff x14 ff00000000000000 x15 ffffffffffffffff
x16 0000007f79d03ed0 x17 0000007f79cad510 x18 0000000000000000 x19 0000007f5da8b4f8
x20 0000000000000006 x21 0000007f5da8b450 x22 000000000000000b x23 0000000000000836
x24 ffffffffffffffff x25 0000007f795fc730 x26 0000007f79587080 x27 0000007f5da88ab1
x28 0000007f7954d29b x29 0000007f5da889e0 x30 0000007f79caa9a0
sp 0000007f5da889c0 pc 0000007f79cad518 pstate 0000000060000000
v0 2e6761742e676f6c2e74736973726570 v1 0000007f5da885400000007f5da889c0
v2 00000000000a00002931363a6176616a v3 00000000000000000000000000000000
v4 00000000001000000000000000000000 v5 40100401401004014010040140100401
v6 00100000000000000010000000000000 v7 000000000000000000000000ebad8077
v8 00000000000000000000000000000000 v9 00000000000000000000000000000000
v10 00000000000000000000000000000000 v11 00000000000000000000000000000000
v12 00000000000000000000000000000000 v13 00000000000000000000000000000000
v14 00000000000000000000000000000000 v15 00000000000000000000000000000000
v16 5a8279995a8279995a8279995a827999 v17 6ed9eba16ed9eba16ed9eba16ed9eba1
v18 8f1bbcdc8f1bbcdc8f1bbcdc8f1bbcdc v19 ca62c1d6ca62c1d6ca62c1d6ca62c1d6
v20 1a4072a0aaed015679f619a02f5afaf0 v21 c1e7b07074b7d89a41d61a2d693230a4
v22 1032547698badcfeefcdab8967452301 v23 000000000000000000000000ebad8087
v24 000000000000000000000000ebad8088 v25 000000000000000000000000ebad8089
v26 000000000000000000000000ebad808a v27 000000000000000000000000ebad808b
v28 000000000000000000000000ebad808c v29 000000000000000000000000ebad808d
v30 000000000000000000000000ebad808e v31 00000000000000000000000000000001
fpsr 00000013 fpcr 00000000
#00 pc 000000000006b518 /system/lib64/ (tgkill+8)
#1 pc 000000000006899c /system/lib64/ (pthread_kill+64)
#2 pc 0000000000023ee8 /system/lib64/ (raise+24)
#3 pc 000000000001c96c /system/lib64/ (abort+52)
#4 pc 00000000002d1b9c /system/lib64/ (offset 0x138000)

Copy link

@Antonkog Antonkog commented Dec 7, 2017

I have same issue with ''
when call with retrofit:
Throwing new exception 'length=668; index=1366' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=668; index=1366
I have this only when launch on real device 6.0.1 and on emulator with api 23 everything works fine.

Copy link

@turkovsky turkovsky commented Dec 19, 2017

I have the same issue, gradle is 3.0.1
Disabling of instant run became helpful

Copy link

@droid-lover droid-lover commented Jun 22, 2018

Disabling of instant run solves this error

I faced the same while running app on Emulator with API 23.

just Disable Instant Run and this error disappear and app works fine.

Copy link

@nysin nysin commented Aug 10, 2018

why when i dissabled the instant run ,but it's also occur.

Copy link

@pedromassango pedromassango commented Oct 25, 2018

Ok, looks like the instant run tip is the perfect solution for this. It worked for me!

Copy link

@draxdave draxdave commented Oct 29, 2018

Ok, looks like the instant run tip is the perfect solution for this. It worked for me!

Disabling of instant run solves this error

I faced the same while running app on Emulator with API 23.

just Disable Instant Run and this error disappear and app works fine.

Disabling the instant run is not a solution unfortunately. It's a workaround and it should be fixed by next updates.

Copy link

@adnanganie adnanganie commented Jan 17, 2019

Try to Disable Instant Run
Another Solution is use Latest Version of Gradle Plugin

Copy link

@korydondzila korydondzila commented Feb 22, 2019

This appears to still be an issue with Marshmallow devices, yes disabling Instant run is a work around but not a fix.

Copy link

@android-x64 android-x64 commented Apr 7, 2021

When I faced the issue I was using next versions of the libraries:

implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'`


and was initializing Retrofit instance like this:


But changing of GsonConverterFactory initializing to GsonConverterFactory.create(GsonBuilder().create()) solved the problem:


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests