ArrayIndexOutOfBoundsException - 改造调用 [英] ArrayIndexOutOfBoundsException - Retrofit Call
问题描述
我正在尝试在我的 Retrofit
实例上调用 PUT
方法:
I am trying to call a PUT
method on my Retrofit
instance:
Response<UpdateUserProfileResponse> response = App.getService().updateUserProfile(//A good 26 parameters).execute();
updateUserProfile()
中的参数是 String、Boolean 和一个 List
的混合.当我调用此方法时,出现以下错误:
The parameters in the updateUserProfile()
are a mixture of String, Boolean and one List<MyObject>
. When I call this method, I get the following error:
Throwing new exception 'length=238; index=1366' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=238; index=1366
06-28 21:53:12.458 3928-6610/com.subby.development A/art: art/runtime/thread.cc:1329] at retrofit2.Response
更新
我发现了这个问题.有两个 RealmList
导致了这个问题.当我评估两个 RealmLists 时,我得到:
I found the issue. There are two RealmList<BackgroundString>
which are causing the issue. When I evaluate both RealmLists, I get:
无法计算表达式方法抛出java.lang.IllegalStateException"异常.
推荐答案
对于遇到此问题的其他任何人,最有可能的实际问题是:https://issuetracker.google.com/issues/37078190即在 Marshmallow/23(甚至可能是 24)上即时运行在 android 运行时存在问题.Android 8/26+ 有一个官方修复程序,但对于大多数人来说,禁用 Instant Run 就足够了.
For anyone else stumbling upon this question, the actual issue most likely is this: https://issuetracker.google.com/issues/37078190 i.e. Instant Run on Marshmallow/23 (and maybe even 24) has issues in the android runtime. Android 8/26+ have an official fix, but for most people disabling Instant Run should be sufficient.
还回复:
https://github.com/square/retrofit/issues/1486
https://github.com/square/retrofit/issues/1506
这篇关于ArrayIndexOutOfBoundsException - 改造调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!