gpt4 book ai didi

android - 改造:偶尔获取 java.util.NoSuchElementException

转载 作者:行者123 更新时间:2023-11-30 01:27:04 29 4
gpt4 key购买 nike

我正在使用 retrofit-beta2,我时常遇到以下崩溃。我不确定我做错了什么。如果有人能给我一个解决问题的提示,那就太好了。

Fatal Exception: java.util.NoSuchElementException
at com.squareup.okhttp.internal.http.RouteSelector.next(RouteSelector.java:79)
at com.squareup.okhttp.internal.http.StreamAllocation.findConnection(StreamAllocation.java:164)
at com.squareup.okhttp.internal.http.StreamAllocation.findHealthyConnection(StreamAllocation.java:126)
at com.squareup.okhttp.internal.http.StreamAllocation.newStream(StreamAllocation.java:95)
at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:283)
at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:224)
at com.squareup.okhttp.Call.getResponse(Call.java:286)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:243)
at com.squareup.okhttp.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:204)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:232)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:205)
at com.squareup.okhttp.Call.access$100(Call.java:35)
at com.squareup.okhttp.Call$AsyncCall.execute(Call.java:171)
at com.squareup.okhttp.internal.NamedRunnable.run(NamedRunnable.java:33)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)

最佳答案

this 中所述问题有两种可能:

OkHttp has a bug where we’re attempting to recover when we shouldn't be because we’ve exhausted all of the available routes.

OkHttp has a bug where you’ve got a custom DNS implementation that returned zero IP addresses for a host and we didn't reject that.

我的建议是使用新版本的 retrofit 和 okhttp,因为 Retrofit 2 已经发布了。

compile 'com.squareup.okhttp3:okhttp:3.1.2'
compile 'com.squareup.retrofit2:retrofit:2.0.0'

关于android - 改造:偶尔获取 java.util.NoSuchElementException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36300234/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com