【问题标题】:okio.Base64.encode ArrayIndexOutOfBoundsException why is that even happening?okio.Base64.encode ArrayIndexOutOfBoundsException 为什么会发生这种情况?
【发布时间】:2018-04-27 02:30:38
【问题描述】:

我注意到 fabric 中的这种异常情况很少发生,但在每次构建中,每周 2-3 个用户(从 ~500 DAU)上会发生 3-5 次崩溃 我没有找到有关此类崩溃的任何信息,有人知道是什么原因导致的吗?

我只发现了一个关于此类问题的问题,但它已被删除为“重复”https://stackoverflow.com/questions/45868217/arrayindexoutofboundsexception-trying-to-cache-certificate-list-in-okhttp3

Fatal Exception: java.lang.ArrayIndexOutOfBoundsException
length=1305; index=1953974520

okio.Base64.encode (Base64.java:137)
okio.Base64.encode (Base64.java:125)
okio.ByteString.base64 (ByteString.java:105)
okhttp3.Cache$Entry.writeCertList (Cache.java:686)
okhttp3.Cache$Entry.writeTo (Cache.java:645)
okhttp3.Cache.put (Cache.java:249)
okhttp3.Cache.access$000 (Cache.java:136)
okhttp3.Cache$1.put (Cache.java:148)
okhttp3.internal.cache.CacheInterceptor.maybeCache (CacheInterceptor.java:173)
okhttp3.internal.cache.CacheInterceptor.intercept (CacheInterceptor.java:143)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:92)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:67)
okhttp3.internal.http.BridgeInterceptor.intercept (BridgeInterceptor.java:93)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:92)
okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept (RetryAndFollowUpInterceptor.java:124)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:92)
okhttp3.internal.http.RealInterceptorChain.proceed (RealInterceptorChain.java:67)

更新:

https://github.com/square/okio/issues/325Okio 本期票 https://issuetracker.google.com/issues/69364976此问题的谷歌票

更新 2: 已在 Android Studio 3.1 Canary 6 Build 中修复

【问题讨论】:

  • 如果您对问题投反对票 - 至少写下原因。
  • I noticed such exception。如果您谈论一个例外,那么至少要提及哪一个。
  • 这里已经发布了:github.com/square/okio/issues/325
  • @greenapps 异常打印有问题
  • @JanMuller 谢谢,确实是昨天才发的,我2天前就搜过了,暂时没有话题。你能把它写成答案吗?我会接受的。

标签: android caching base64 okhttp crash-reports


【解决方案1】:

这可能是从 11 月 8 日开始仅在 Android 5.1 上的特定设备上的 VM 中的错误。

我们发现问题是使用dex编译器D8引起的。解决方案是通过以下行在 gradle.properties 中禁用它:android.enableD8=false

票已在此处创建

Okio issue tracker

它影响了几乎所有低成本手机,不包括三星设备

【讨论】:

    【解决方案2】:

    这是 VM 或 VM 周围的基础架构(CPU?内存?)中的错误。在 0 和数组长度之间循环的值 i 没有其他方法可以超出这样的范围。

    【讨论】:

      猜你喜欢
      • 2021-01-24
      • 1970-01-01
      • 2021-04-30
      • 2010-09-22
      • 1970-01-01
      • 2013-08-02
      • 2018-12-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多