我正在尝试将Firebase InApp消息传递集成到我的android应用程序中。在gradle中添加以下依赖项后 实施'com.google.firebase:firebase-inappmessaging-display:18.0.2'
它抛出以下错误: 重大例外:RxCachedThreadScheduler-1 io.reactivex.exceptions.UndeliverableException:无法将异常传递给使用者,因为它已经取消/处理了该流,或者该异常无处可去。进一步阅读:https://github.com/ReactiveX/RxJava/wiki/What's-different-in-2.0#error-handling | java.lang.NoClassDefFoundError:com.google.common.base.CharMatcher 在io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367) 在io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69) 在io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) 在java.util.concurrent.FutureTask.run(FutureTask.java:237) 在java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.access $ 201(ScheduledThreadPoolExecutor.java:154) 在java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:588) 在java.lang.Thread.run(Thread.java:818) 造成原因:java.lang.NoClassDefFoundError:com.google.common.base.CharMatcher 在com.google.common.base.Splitter.on(Splitter.java:125) 在io.grpc.internal.GrpcUtil(GrpcUtil.java:203) 在io.grpc.internal.AbstractManagedChannelImplBuilder。(AbstractManagedChannelImplBuilder.java:84) 在io.grpc.okhttp.OkHttpChannelBuilder.forTarget(OkHttpChannelBuilder.java:119) 在io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:48) 在io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:27) 在io.grpc.ManagedChannelBuilder.forTarget(ManagedChannelBuilder.java:73) com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule.providesGrpcChannel(com.google.firebase:firebase-inappmessaging @@ 18.0.2:41) 在com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.providesGrpcChannel(com.google.firebase:firebase-inappmessaging @@ 18.0.2:36) 在com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.get(com.google.firebase:firebase-inappmessaging @@ 18.0.2:26) 在com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.get(com.google.firebase:firebase-inappmessaging @@ 18.0.2:9) 在dagger.internal.DoubleCheck.get(DoubleCheck.java:47) com.google.firebase.inappmessaging.internal.injection.components.DaggerUniversalComponent.gRPCChannel(com.google.firebase:firebase-inappmessaging @@ 18.0.2:280) com.google.firebase.inappmessaging.internal.injection.components.DaggerAppComponent $ com_google_firebase_inappmessaging_internal_injection_components_UniversalComponent_gRPCChannel.get(com.google.firebase:firebase-inappmessaging @@ 18.0.2:437) com.google.firebase.inappmessaging.internal.injection.components.DaggerAppComponent $ com_google_firebase_inappmessaging_internal_injection_components_UniversalComponent_gRPCChannel.get(com.google.firebase:firebase-inappmessaging @@ 18.0.2:424) 在com.google.firebase.inappmessaging.internal.injection.modules.GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.get(com.google.firebase:firebase-inappmessaging @@ 18.0.2:35) 在com.google.firebase.inappmessaging.internal.injection.modules.GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.get(com.google.firebase:firebase-inappmessaging @@ 18.0.2:11) 在dagger.internal.DoubleCheck.get(DoubleCheck.java:47) 在com.google.firebase.inappmessaging.internal.GrpcClient_Factory.get(com.google.firebase:firebase-inappmessaging @@ 18.0.2:23) 在com.google.firebase.inappmessaging.internal.GrpcClient_Factory.get(com.google.firebase:firebase-inappmessaging @@ 18.0.2:8) 在dagger.internal.DoubleCheck.get(DoubleCheck.java:47) 请访问com.google.firebase.inappmessaging.internal.ApiClient.getFiams(com.google.firebase:firebase-inappmessaging @@ 18.0.2:8)
这可以在其他Android操作系统上正常工作,并已通过7.0、8.0和9.0验证。 注意:已添加 androidx 支持。
这些是我的gradle依赖项:
implementation 'com.google.android.gms:play-services-analytics:17.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.media:media:1.0.1'
implementation 'androidx.vectordrawable:vectordrawable-animated:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.guava:guava:28.0-jre'
//noinspection GradleDependency
implementation 'com.google.dagger:dagger:2.21'
//noinspection GradleDependency
kapt 'com.google.dagger:dagger-compiler:2.21'
//noinspection GradleDependency,OutdatedLibrary
implementation 'com.google.dagger:dagger-android:2.21'
//noinspection GradleDependency
implementation 'com.google.dagger:dagger-android-support:2.21'
//noinspection GradleDependency
kapt 'com.google.dagger:dagger-android-processor:2.21'
compileOnly 'javax.annotation:jsr250-api:1.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation 'io.reactivex.rxjava2:rxjava:2.2.6'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex:rxjava:1.3.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
有人遇到过这个吗?
答案 0 :(得分:0)
尝试将Guava添加到依赖项中,似乎可以解决此问题:
implementation 'com.google.guava:guava:29.0-android'