Okhttp exception java.lang.AssertionError on Android 11 sdk



我使用com.squareup.okhttp3:okhttp:4.4.1但是什么时候应该显示firebase-in-app消息(当应用程序启动时(应用程序在11安卓上崩溃。在mainactivity中我根本不使用Okhttp。使用'com.google.firebase:firebase-inappmessaging-display:19.1.5'尝试了不同版本的

okhttp and firebase inappmessaging display
Fatal Exception: java.lang.AssertionError
Method getAlpnSelectedProtocol not supported for object SSL socket over Socket[address=firebaseinappmessaging.googleapis.com/***,port=*,localPort=*
Fatal Exception: java.lang.AssertionError: Method getAlpnSelectedProtocol not supported for object SSL socket over Socket[address=firebaseinappmessaging.googleapis.com/***,port=*,localPort=*]
at io.grpc.okhttp.internal.OptionalMethod.invoke(OptionalMethod.java:67)
at io.grpc.okhttp.internal.OptionalMethod.invokeWithoutCheckedException(OptionalMethod.java)
at io.grpc.okhttp.OkHttpProtocolNegotiator$AndroidNegotiator.b(OkHttpProtocolNegotiator.java:15)
at io.grpc.okhttp.OkHttpProtocolNegotiator$AndroidNegotiator.negotiate(OkHttpProtocolNegotiator.java)
at io.grpc.okhttp.OkHttpTlsUpgrader.upgrade(OkHttpTlsUpgrader.java:8)
at io.grpc.okhttp.OkHttpClientTransport$4.run(OkHttpClientTransport.java:17)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:11)
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)



dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation('com.google.android.material:material:1.3.0') {
exclude group: 'androidx'
}
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation('androidx.lifecycle:lifecycle-extensions:2.2.0') {
exclude group: 'androidx'
}
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation('com.squareup.picasso:picasso:2.71828') {
exclude group: 'com.android.support'
exclude module: ['exifinterface', 'support-annotations']
}
implementation 'com.jakewharton:butterknife:10.2.3'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
implementation 'io.reactivex.rxjava2:rxjava:2.2.21'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'org.jsoup:jsoup:1.13.1'
implementation 'com.r0adkll:slidableactivity:2.1.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'de.hdodenhof:circleimageview:3.1.0'
//noinspection GradleDependency
implementation 'com.squareup.okhttp3:okhttp:4.4.1'
implementation 'com.google.android.exoplayer:exoplayer:2.10.4'
implementation 'com.google.android.exoplayer:extension-okhttp:2.10.4'
implementation('com.google.firebase:firebase-analytics:18.0.2') {
exclude group: 'androidx'
}
implementation('com.google.firebase:firebase-core:18.0.2') {
exclude group: 'androidx'
}
implementation('com.google.firebase:firebase-perf:19.1.1') {
exclude group: 'androidx'
}
implementation 'tech.schoolhelper:moxy-x-androidx:1.7.0'
implementation 'com.google.firebase:firebase-crashlytics:17.3.1'
implementation 'tech.schoolhelper:moxy-x:1.7.0'
annotationProcessor 'tech.schoolhelper:moxy-x-compiler:1.7.0'
implementation 'tech.schoolhelper:moxy-x-androidx:1.7.0'
implementation 'tech.schoolhelper:moxy-x-material:1.7.0'
implementation 'com.android.support:preference-v7:30.0.0'
implementation 'pub.devrel:easypermissions:0.2.0'
implementation 'com.github.codekidX:storage-chooser:2.0.4.4'
implementation 'com.github.chrisbanes:PhotoView:2.3.0'
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.google.firebase:firebase-ads:19.7.0'
implementation('com.android.billingclient:billing:3.0.2') {
exclude group: 'androidx'
}
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.6'
implementation 'com.alimuzaffar.lib:pinentryedittext:2.0.6'
implementation 'com.mindorks.android:prdownloader:0.6.0'
implementation('com.stepstone.apprating:app-rating:2.3.1') {
exclude group: 'androidx'
}
implementation 'com.diogobernardino:williamchart:2.2'
implementation 'com.h6ah4i.android.widget.verticalseekbar:verticalseekbar:1.0.0'
implementation('com.google.firebase:firebase-inappmessaging-display:19.1.5') {
exclude group: 'androidx'
}
implementation 'com.google.android.exoplayer:exoplayer:2.10.4'
implementation 'com.github.lzyzsd:circleprogress:1.2.1'
implementation 'it.xabaras.android:recyclerview-swipedecorator:1.2.3'

这是一个已知的问题https://github.com/firebase/firebase-android-sdk/issues/2642

可能的解决方法

implementation('com.google.firebase:firebase-inappmessaging-display:19.1.5', {
exclude group: 'io.grpc', module: 'grpc-okhttp'
})
implementation 'io.grpc:grpc-okhttp:1.32.2'

最新更新