E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Version inconsistency 4.9.0 and 4.11.0 如何解决?
E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher Version inconsistency 4.9.0 and 4.11.0 How to resolve?
这是我的 okhttp gradle 版本:
implementation 'com.github.bumptech.glide:okhttp3-integration:4.11.0'
还有我的 okHttp 记录器库。
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
我在 github 上发现了这个问题,这里的回复说这是由于版本不一致造成的。 https://github.com/square/okhttp/issues/2839#issuecomment-244923226
但是 Okhttp 记录器还没有更新他们的库 OkHttp 版本是 4.9.0
但 okHttp 是 4.11.0
。我可以将版本降低到 4.9.0
但我不想这样做。就像 Jake Wharton 在这里的建议:https://github.com/square/okhttp/issues/2839#issuecomment-245269471
E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: tech.guzo.awtar, PID: 7624
java.lang.NoSuchMethodError: No virtual method log(ILjava/lang/String;Ljava/lang/Throwable;)V in class Lokhttp3/internal/platform/Platform; or its super classes (declaration of 'okhttp3.internal.platform.Platform' appears in /data/app/tech.guzo.awtar-XZo1TJ-jaQnVlyXeTlwUdQ==/base.apk!classes3.dex)
at okhttp3.logging.HttpLoggingInterceptor$Logger.log(HttpLoggingInterceptor.java:111)
at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:159)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at com.yenepay.yegid.net.ServerAPI.intercept(ServerAPI.java:106)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:502)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
有人可以告诉我你是如何克服这个问题的吗?
你不应该依赖瞬态依赖,你应该只列出你在运行时依赖的所有版本作为你的直接依赖。
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
这是我的 okhttp gradle 版本:
implementation 'com.github.bumptech.glide:okhttp3-integration:4.11.0'
还有我的 okHttp 记录器库。
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
我在 github 上发现了这个问题,这里的回复说这是由于版本不一致造成的。 https://github.com/square/okhttp/issues/2839#issuecomment-244923226
但是 Okhttp 记录器还没有更新他们的库 OkHttp 版本是 4.9.0
但 okHttp 是 4.11.0
。我可以将版本降低到 4.9.0
但我不想这样做。就像 Jake Wharton 在这里的建议:https://github.com/square/okhttp/issues/2839#issuecomment-245269471
E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
Process: tech.guzo.awtar, PID: 7624
java.lang.NoSuchMethodError: No virtual method log(ILjava/lang/String;Ljava/lang/Throwable;)V in class Lokhttp3/internal/platform/Platform; or its super classes (declaration of 'okhttp3.internal.platform.Platform' appears in /data/app/tech.guzo.awtar-XZo1TJ-jaQnVlyXeTlwUdQ==/base.apk!classes3.dex)
at okhttp3.logging.HttpLoggingInterceptor$Logger.log(HttpLoggingInterceptor.java:111)
at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:159)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at com.yenepay.yegid.net.ServerAPI.intercept(ServerAPI.java:106)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.kt:100)
at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.kt:197)
at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:502)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
at java.lang.Thread.run(Thread.java:764)
有人可以告诉我你是如何克服这个问题的吗?
你不应该依赖瞬态依赖,你应该只列出你在运行时依赖的所有版本作为你的直接依赖。
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'