4

我的应用程序在打开时因此错误而崩溃,仅在 Android 6 和 Android 5 上:

io.reactivex.exceptions.UndeliverableException: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/base/CharMatcher;
        at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:367)
        at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:69)
        at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57)
        at java.util.concurrent.FutureTask.run(FutureTask.java:237)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
        at java.lang.Thread.run(Thread.java:818)
     Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/common/base/CharMatcher;
        at com.google.common.base.Splitter.on(Splitter.java:125)
        at io.grpc.internal.GrpcUtil.<clinit>(GrpcUtil.java:203)
        at io.grpc.internal.AbstractManagedChannelImplBuilder.<clinit>(AbstractManagedChannelImplBuilder.java:84)
        at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:48)
        at io.grpc.okhttp.OkHttpChannelProvider.builderForTarget(OkHttpChannelProvider.java:27)
        at io.grpc.ManagedChannelBuilder.forTarget(ManagedChannelBuilder.java:73)
        at com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule.providesGrpcChannel(com.google.firebase:firebase-inappmessaging@@19.0.3:41)
        at com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.providesGrpcChannel(com.google.firebase:firebase-inappmessaging@@19.0.3:39)
        at com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.get(com.google.firebase:firebase-inappmessaging@@19.0.3:30)
        at com.google.firebase.inappmessaging.internal.injection.modules.GrpcChannelModule_ProvidesGrpcChannelFactory.get(com.google.firebase:firebase-inappmessaging@@19.0.3:9)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.google.firebase.inappmessaging.internal.injection.components.DaggerUniversalComponent.gRPCChannel(com.google.firebase:firebase-inappmessaging@@19.0.3:188)
        at com.google.firebase.inappmessaging.internal.injection.components.DaggerAppComponent$com_google_firebase_inappmessaging_internal_injection_components_UniversalComponent_gRPCChannel.get(com.google.firebase:firebase-inappmessaging@@19.0.3:295)
        at com.google.firebase.inappmessaging.internal.injection.components.DaggerAppComponent$com_google_firebase_inappmessaging_internal_injection_components_UniversalComponent_gRPCChannel.get(com.google.firebase:firebase-inappmessaging@@19.0.3:285)
        at com.google.firebase.inappmessaging.internal.injection.modules.GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.get(com.google.firebase:firebase-inappmessaging@@19.0.3:35)
        at com.google.firebase.inappmessaging.internal.injection.modules.GrpcClientModule_ProvidesInAppMessagingSdkServingStubFactory.get(com.google.firebase:firebase-inappmessaging@@19.0.3:11)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.google.firebase.inappmessaging.internal.GrpcClient_Factory.get(com.google.firebase:firebase-inappmessaging@@19.0.3:26)
        at com.google.firebase.inappmessaging.internal.GrpcClient_Factory.get(com.google.firebase:firebase-inappmessaging@@19.0.3:8)
        at dagger.internal.DoubleCheck.get(DoubleCheck.java:47)
        at com.google.firebase.inappmessaging.internal.ApiClient.getFiams(com.google.firebase:firebase-inappmessaging@@19.0.3:101)
        at com.google.firebase.inappmessaging.internal.InAppMessageStreamManager.lambda$createFirebaseInAppMessageStream$16(com.google.firebase:firebase-inappmessaging@@19.0.3:231)
        at com.google.firebase.inappmessaging.internal.InAppMessageStreamManager$$Lambda$22.call(com.google.firebase:firebase-inappmessaging@@19.0.3)
        at io.reactivex.internal.operators.maybe.M

这是我的毕业设置:

compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {

    ...

    minSdkVersion 21
    targetSdkVersion 28

    ...

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
    multiDexEnabled true

}

我正在使用最新版本的 Firebase InApp 消息传递

implementation 'com.google.firebase:firebase-inappmessaging-display:19.0.3'

我已经发现了这些问题,但没有解决方案:

有没有人有同样的问题?

更新

我解决了将 Google Guava 库添加到 gradle 的问题

implementation "com.google.guava:guava:28.2-android"

4

1 回答 1

0

使用以下依赖项来解决问题

要使用 Gradle 添加依赖项,请使用以下命令:

implementation "com.google.guava:guava:28.2-android"

有关最新的番石榴库,请参阅此文档

于 2020-03-09T02:59:27.003 回答