当我在app/build.gradle中使用implementation 'com.google.firebase:firebase-inappmessaging-display:17.2.0'时,会出现以下错误:

Duplicate class com.google.common.util.concurrent.ListenableFuture found in modules guava-20.0.jar (com.google.guava:guava:20.0) and listenablefuture-1.0.jar (com.google.guava:listenablefuture:1.0)

Go to the documentation to learn how to Fix dependency resolution errors.

在我的app/build.gradle岁生日中,我还有以下几点:

implementation 'com.google.android.gms:play-services-base:16.1.0'
implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.google.android.gms:play-services-awareness:16.0.0'
implementation 'com.google.android.gms:play-services-cast:16.2.0'
implementation 'com.google.android.gms:play-services-gcm:16.1.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.google.firebase:firebase-iid:17.1.2'
implementation 'com.google.firebase:firebase-messaging:17.6.0'
implementation 'android.arch.work:work-runtime:1.0.1'
implementation 'com.android.support:multidex:1.0.3'
apply plugin: 'com.google.gms.google-services'

也许我正在使用的其中一个库已经包含了对应用内消息依赖性的支持,然后它就变得多余了?非常感谢.

推荐答案

我在How to solve Program type already present: com.google.common.util.concurrent.ListenableFuture?岁时找到了答案.用户2297550说:

我只是在我的应用程序gradle文件末尾加了implementation 'com.google.guava:guava:27.0.1-android',错误就消失了.

这就是我的解决方案.现在我有了这个,我的应用程序编译正确:

implementation 'com.google.firebase:firebase-inappmessaging-display:17.2.0'
implementation 'com.google.guava:guava:27.0.1-android'

Android相关问答推荐

无法理解Kotlin Coroutines and Flows中的J.C.编程行为

Android意图过滤器不限制应用程序仅处理YouTube链接

如何检测HitTest是否命中给定的网格对象?

在不增加父行宽度的情况下添加延迟行或可滚动行

如何修复Google Play市场中有关已删除广告库的错误消息?

Jetpack Compose:如何将文本放置在行的右侧?

Jetpack Compose 使用 SavedStateHandle 发送返回结果不适用于 ViewModel 中注入的 SavedStateHandle

Android 应用程序从 Android Studio 安装,但不是作为 .apk 在外部安装.抛出java.lang.UnsatisfiedLinkError

如何在 Jetpack Compose 中对数据类进行 Parcelize

如何以编程方式通过 whatsapp android 共享图像和文本

Visual Studio 无法在 Android 上编译 .NET MAUI 项目

如何在 JetpackCompose 的 LazyColumn 中 Select 多个项目

如何在 Jetpack Compose 中设置行宽等于 TextField 的宽度?

在 Jetpack Compose 中单击时更改表面项目的背景 colored颜色

在jetpack compose中将图像添加到脚手架顶部栏

如何在 Jetpack compose 中将 Canvas 中的文本居中?

构成material 3 中的分隔符

Jetpack 使用 Canvas 组成半圆

使用 Android 字符串数组在 Room 中迁移

在 Android Studio 中保存数据