美文网首页
ART Runtime ArrayIndexOutOfBound

ART Runtime ArrayIndexOutOfBound

作者: 曾经的你呀 | 来源:发表于2019-05-25 17:07 被阅读0次

使用Retrofit 进行http请求遇到的这个问题描述是这样子的:https://github.com/square/retrofit/issues/1486

然后大神的结论是:This is a build system problem, not a Retrofit problem. There is a bug filed in the appropriate place.

遇到这个问题是我升级AS后Gradle 没能升级到最新,因为华为推送(嘿嘿,骂华为推送的人挺多的)低版本的依赖不能使用最新的Gradle ,被迫Gradle 降级。总之就是升级了开发环境,Gradle 什么的,然后我们编译一般都是会打开Instant run 的,然后使用Retrofit 的时候就出错了。

A/art: art/runtime/thread.cc:1344] Throwing new exception 'length=248; index=1273' with unexpected pending exception: java.lang.ArrayIndexOutOfBoundsException: length=248; index=1273

无厘头的探索之路

出现这种问题真的很无厘头,正式包没有问题,Android 9系统调试没问题,只有Android 6 有问题。有怀疑是用Instant run 调试开车出的问题,可是没有证据,大神也只说是build system problem 问题。越想越有味,周末吃过饭睡了一觉来到公司。盯着代码:

    //获取今日排班和打卡记录
    @GET()
    Observable<HttpResponse<ScheduleAndSignedCard>> getScheduleAndSignedCard();

    /**
     * 获取今日排班和打卡记录
     *
     */
    private void getScheduleAndSignedCard() {
        HttpCall.getApiService().getScheduleAndSignedCard(urlPath)
                .compose(RxObservableUtils.IO2MainSchedulers())
                .subscribe(new BaseObserver<ScheduleAndSignedCard>(mContext) {
                    @Override
                    public void onSuccess(ScheduleAndSignedCard scheduleAndSignedCard) {
                         //...
                    }

                    @Override
                    public void onFailure(int code, String message) {
                        super.onFailure(code, message);
                    }
                });
    }

发现 方法private void getScheduleAndSignedCard() 调用的的http 请求的方法也是 Observable<HttpResponse<ScheduleAndSignedCard>> getScheduleAndSignedCard()
会不会是同名造成的???

image.png

修改其中一个,重新Run果然OK了。真实无厘头了,朋友们也有这情况吗?

相关文章

网友评论

      本文标题:ART Runtime ArrayIndexOutOfBound

      本文链接:https://www.haomeiwen.com/subject/ndfzzqtx.html