OkHttp 4.3.1 spams log, didn't find class "org.conscrypt.ConscryptHostnameVerifier" on path
See original GitHub issueA trivial use of OkHttp 4.3.1 causes some spam in the device log.
https://gist.github.com/jamesonwilliams/8ab7237083467ed3cb8680115a3e3829
This code:
Disposable disposable = Single.fromCallable(() ->
new OkHttpClient().newCall(new Request.Builder()
.url("https://raw.githubusercontent.com/square/okhttp/master/README.md")
.get()
.build())
.execute()
.body()
.string()
)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
textView::setText,
failure -> textView.setText(Log.getStackTraceString(failure))
);
With this OkHttp:
implementation 'com.squareup.okhttp3:okhttp:4.3.1'
Causes this spam, as the out-of-the-box default:
I: Rejecting re-init on previously-failed class java.lang.Class<okhttp3.internal.platform.ConscryptPlatform$configureTrustManager$1>: java.lang.NoClassDefFoundError: Failed resolution of: Lorg/conscrypt/ConscryptHostnameVerifier;
I: at okhttp3.internal.platform.android.SocketAdapter okhttp3.internal.platform.android.ConscryptSocketAdapter$Companion.buildIfSupported() (ConscryptSocketAdapter.kt:62)
I: at void okhttp3.internal.platform.AndroidPlatform.<init>() (AndroidPlatform.kt:44)
I: at okhttp3.internal.platform.Platform okhttp3.internal.platform.AndroidPlatform$Companion.buildIfSupported() (AndroidPlatform.kt:212)
I: at okhttp3.internal.platform.Platform okhttp3.internal.platform.Platform$Companion.findPlatform() (Platform.kt:207)
I: at okhttp3.internal.platform.Platform okhttp3.internal.platform.Platform$Companion.access$findPlatform(okhttp3.internal.platform.Platform$Companion) (Platform.kt:169)
I: at void okhttp3.internal.platform.Platform.<clinit>() (Platform.kt:170)
I: at void okhttp3.OkHttpClient.<init>(okhttp3.OkHttpClient$Builder) (OkHttpClient.kt:220)
I: at void okhttp3.OkHttpClient.<init>() (OkHttpClient.kt:212)
I: at java.lang.String okhttp.conscrypt.issue.MainActivity.lambda$onCreate$0() (MainActivity.java:28)
I: at java.lang.Object okhttp.conscrypt.issue.-$$Lambda$MainActivity$HFmP7xhC1oUdC6d5U0mKIdLTGns.call() (lambda:-1)
I: at void io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(io.reactivex.SingleObserver) (SingleFromCallable.java:44)
I: at void io.reactivex.Single.subscribe(io.reactivex.SingleObserver) (Single.java:3666)
I: at void io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run() (SingleSubscribeOn.java:89)
I: at void io.reactivex.Scheduler$DisposeTask.run() (Scheduler.java:578)
I: at void io.reactivex.internal.schedulers.ScheduledRunnable.run() (ScheduledRunnable.java:66)
I: at java.lang.Object io.reactivex.internal.schedulers.ScheduledRunnable.call() (ScheduledRunnable.java:57)
I: at void java.util.concurrent.FutureTask.run() (FutureTask.java:237)
I: at void java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run() (ScheduledThreadPoolExecutor.java:272)
I: at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1133)
I: at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:607)
I: at void java.lang.Thread.run() (Thread.java:761)
I: Caused by: java.lang.ClassNotFoundException: Didn't find class "org.conscrypt.ConscryptHostnameVerifier" on path: DexPathList[[zip file "/data/app/okhttp.conscrypt.issue-2/base.apk"],nativeLibraryDirectories=[/data/app/okhttp.conscrypt.issue-2/lib/x86, /system/lib, /vendor/lib]]
I: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:56)
I: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:380)
I: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
I: at okhttp3.internal.platform.android.SocketAdapter okhttp3.internal.platform.android.ConscryptSocketAdapter$Companion.buildIfSupported() (ConscryptSocketAdapter.kt:62)
I: at void okhttp3.internal.platform.AndroidPlatform.<init>() (AndroidPlatform.kt:44)
I: at okhttp3.internal.platform.Platform okhttp3.internal.platform.AndroidPlatform$Companion.buildIfSupported() (AndroidPlatform.kt:212)
I: at okhttp3.internal.platform.Platform okhttp3.internal.platform.Platform$Companion.findPlatform() (Platform.kt:207)
I: at okhttp3.internal.platform.Platform okhttp3.internal.platform.Platform$Companion.access$findPlatform(okhttp3.internal.platform.Platform$Companion) (Platform.kt:169)
I: at void okhttp3.internal.platform.Platform.<clinit>() (Platform.kt:170)
I: at void okhttp3.OkHttpClient.<init>(okhttp3.OkHttpClient$Builder) (OkHttpClient.kt:220)
I: at void okhttp3.OkHttpClient.<init>() (OkHttpClient.kt:212)
I: at java.lang.String okhttp.conscrypt.issue.MainActivity.lambda$onCreate$0() (MainActivity.java:28)
I: at java.lang.Object okhttp.conscrypt.issue.-$$Lambda$MainActivity$HFmP7xhC1oUdC6d5U0mKIdLTGns.call() (lambda:-1)
I: at void io.reactivex.internal.operators.single.SingleFromCallable.subscribeActual(io.reactivex.SingleObserver) (SingleFromCallable.java:44)
I: at void io.reactivex.Single.subscribe(io.reactivex.SingleObserver) (Single.java:3666)
I: at void io.reactivex.internal.operators.single.SingleSubscribeOn$SubscribeOnObserver.run() (SingleSubscribeOn.java:89)
I: at void io.reactivex.Scheduler$DisposeTask.run() (Scheduler.java:578)
I: at void io.reactivex.internal.schedulers.ScheduledRunnable.run() (ScheduledRunnable.java:66)
I: at java.lang.Object io.reactivex.internal.schedulers.ScheduledRunnable.call() (ScheduledRunnable.java:57)
I: at void java.util.concurrent.FutureTask.run() (FutureTask.java:237)
I: at void java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run() (ScheduledThreadPoolExecutor.java:272)
I: at void java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) (ThreadPoolExecutor.java:1133)
I: at void java.util.concurrent.ThreadPoolExecutor$Worker.run() (ThreadPoolExecutor.java:607)
I: at void java.lang.Thread.run() (Thread.java:761)
I am not using Conscrypt. I do not include it in my Android project’s Gradle dependencies. I do agree with the view point of this StackOverflow comment from kroegerama@
:
If okHttp needs conscrypt, it should reference this library instead of forcing us to add this dependency. This should not be marked as accepted. Better file a bug report on square’s github repo. – kroegerama Nov 7 '19 at 14:07
Issue Analytics
- State:
- Created 4 years ago
- Reactions:21
- Comments:24 (1 by maintainers)
Top Results From Across the Web
Rejecting re-init on previously-failed class in OkHttp
While reading the info message, it gives me an idea about this Conscrypt and did a research and found out that I need...
Read more >【okhttp3+Kotlin】Rejecting re-init on previously-failed class ...
OkHttp 4.3.1 spams log, didn't find class “org.conscrypt.ConscryptHostnameVerifier” on path #5760. 2020/05/28 更新:BugのLabelがついている。
Read more >3.x Change Log - OkHttp
Fix: Don't crash when running as a plugin in Android Studio Canary 4.1. To enable platform-specific TLS features OkHttp must detect whether it's...
Read more >windows 10 system,check out error,filename is too long - Java ...
Secure. Instantly Familiar. - ClassicPress · okhttp OkHttp 4.3.1 spams log, didn't find class "org.conscrypt.ConscryptHostnameVerifier" on path - Kotlin ...
Read more >OkHttp 4.3.1 spams log, didn't find class "org.conscrypt ...
Okhttp : OkHttp 4.3.1 spams log, didn't find class "org.conscrypt.ConscryptHostnameVerifier" on path. Created on 30 Jan 2020 · 21Comments · Source: square/ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi! I just noticed that the error keeps occurring with OkHttp 4.8.1, along with other missing classes from bouncycastle, openjsse and android:
Have we got any update on this bug?
Hi! Noticed the same logs for
versionRetrofit = ‘2.9.0’ versionOkHttp = ‘4.7.2’