Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/react-native/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 在React Navtive GET请求期间发生Okhttp错误_React Native_Okhttp_React Android - Fatal编程技术网

React native 在React Navtive GET请求期间发生Okhttp错误

React native 在React Navtive GET请求期间发生Okhttp错误,react-native,okhttp,react-android,React Native,Okhttp,React Android,在react本机项目中的其他有效GET请求期间收到此错误 2020-08-11 12:12:54.163 7301-7498/com.cigna.mobile.mycigna.debug E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Process: com.cigna.mobile.mycigna.debug, PID: 7301 java.lang.NoSuchMethodError: No static metho

在react本机项目中的其他有效GET请求期间收到此错误

2020-08-11 12:12:54.163 7301-7498/com.cigna.mobile.mycigna.debug E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
    Process: com.cigna.mobile.mycigna.debug, PID: 7301
    java.lang.NoSuchMethodError: No static method delimiterOffset(Ljava/lang/String;IILjava/lang/String;)I in class Lokhttp3/internal/Util; or its super classes (declaration of 'okhttp3.internal.Util' appears in /data/app/~~-wSG5UWGWR49_zqj0uGdfw==/com.cigna.mobile.mycigna.debug-O6Kl4LYWC-jBUFRzAxGZug==/base.apk!classes6.dex)
        at okhttp3.JavaNetCookieJar.decodeHeaderAsJavaNetCookies(JavaNetCookieJar.java:91)
        at okhttp3.JavaNetCookieJar.loadForRequest(JavaNetCookieJar.java:74)
        at com.facebook.react.modules.network.ReactCookieJarContainer.loadForRequest(ReactCookieJarContainer.java:44)
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.kt:75)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.kt:71)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:112)
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:87)
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.kt:184)
        at okhttp3.RealCall$AsyncCall.run(RealCall.kt:136)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
2020-08-11 12:12:54.552 631-716/system_process E/InputDispatcher: channel '94b38db com.cigna.mobile.mycigna.debug/com.cigna.mycigna.ui.dashboard.HomeActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

我的应用程序上的所有其他api请求都可以正常工作。同样,上面提到的请求在iOS上也同样有效。

您有两个库:okhttp和okhttp urlconnection。它们必须在相同的精确版本上,否则您可能会收到此错误。

这就是原因。非常感谢。