简体   繁体   中英

Koush ION crashes after Gradle upgrade

After Gradle upgrade ION gives me this error, when trying to send very simple request. It gives me same error on AVD and my physical device. For now I dodged error with going reverting the upgrade. What could be causing following error?

2020-10-24 12:34:14.275 20605-20647/my.example.project E/AndroidRuntime: FATAL EXCEPTION: ion-ion
Process: my.example.project, PID: 20605
java.lang.AssertionError
    at com.koushikdutta.async.AsyncSSLSocketWrapper.write(AsyncSSLSocketWrapper.java:474)
    at com.koushikdutta.async.AsyncSSLSocketWrapper.handleHandshakeStatus(AsyncSSLSocketWrapper.java:378)
    at com.koushikdutta.async.AsyncSSLSocketWrapper.handshake(AsyncSSLSocketWrapper.java:182)
    at com.koushikdutta.async.http.AsyncSSLSocketMiddleware.tryHandshake(AsyncSSLSocketMiddleware.java:89)
    at com.koushikdutta.async.http.AsyncSSLSocketMiddleware$2.onConnectCompleted(AsyncSSLSocketMiddleware.java:106)
    at com.koushikdutta.async.http.AsyncSocketMiddleware.lambda$getSocket$3$AsyncSocketMiddleware(AsyncSocketMiddleware.java:217)
    at com.koushikdutta.async.http.-$$Lambda$AsyncSocketMiddleware$glazjOxu-iNIRY4N890Wl1ngyGo.onCompleted(Unknown Source:12)
    at com.koushikdutta.async.future.SimpleFuture.lambda$setCallback$0(SimpleFuture.java:216)
    at com.koushikdutta.async.future.-$$Lambda$SimpleFuture$h_gK5Y1XHZI1H8JTE2xOg4dXbp8.onCompleted(Unknown Source:2)
    at com.koushikdutta.async.future.SimpleFuture$FutureCallsite.loop(SimpleFuture.java:130)
    at com.koushikdutta.async.future.SimpleFuture.handleCallbackUnlocked(SimpleFuture.java:153)
    at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java:195)
    at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java:175)
    at com.koushikdutta.async.future.-$$Lambda$VNAuWcttAhMr3VsWCERbmWE6yR0.success(Unknown Source:2)
    at com.koushikdutta.async.future.SimpleFuture.lambda$success$4(SimpleFuture.java:287)
    at com.koushikdutta.async.future.-$$Lambda$SimpleFuture$DxIsaj7NQi76eWgOKS4iviWPLV0.onCompleted(Unknown Source:4)
    at com.koushikdutta.async.future.SimpleFuture$FutureCallsite.loop(SimpleFuture.java:130)
    at com.koushikdutta.async.future.SimpleFuture.handleCallbackUnlocked(SimpleFuture.java:153)
    at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java:195)
    at com.koushikdutta.async.future.SimpleFuture.setComplete(SimpleFuture.java:182)
    at com.koushikdutta.async.http.-$$Lambda$cBC5du-82c5EcL72rP5wNK7Y2Y4.onConnectCompleted(Unknown Source:2)
    at com.koushikdutta.async.AsyncServer.runLoop(AsyncServer.java:906)
    at com.koushikdutta.async.AsyncServer.run(AsyncServer.java:727)
    at com.koushikdutta.async.AsyncServer.access$800(AsyncServer.java:46)
    at com.koushikdutta.async.AsyncServer$8.run(AsyncServer.java:681)

I can't find same error in issues list of this library.

Did you try this: https://github.com/koush/ion/issues/937 ?

Solution 1:
Go to: File > Invalidate Caches/Restart and select Invalidate and Restart

Solution 2:
Go to: Build > Select Build Variant and select release instead of debug

我回答有点晚了,但如果有人仍在寻找解决方案,只需在app.gradle文件中将 Ion 版本更新为3.1.0即可修复崩溃。

implementation 'com.koushikdutta.ion:ion:3.1.0'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM