ListenableFuture 消失到哪里了?

问题描述 投票:0回答:1

我的应用程序突然不再构建并出现此错误:

错误:com.google.common.util.concurrent 包不存在

导入 com.google.common.util.concurrent.ListenableFuture;

为什么突然这样?这在相当长的一段时间内运行良好。所有库都是最新的。我需要做什么才能再次编译?

更新:这是升级后发生的事情

implementation 'com.google.android.gms:play-services-ads:22.3.0'

implementation 'com.google.android.gms:play-services-ads:22.4.0'

回到22.3.0版本,一切都很好。这是广告库中的错误吗?不同库版本的一些奇怪的版本混合,可能有空间或其他什么?

android android-studio android-gradle-plugin admob google-play-services
1个回答
0
投票

如果需要,您可以添加显式依赖项

ListenableFuture

https://developer.android.com/guide/background/asynchronous/listenablefuture

dependencies {
    implementation "com.google.guava:guava:31.0.1-android"

    // To use CallbackToFutureAdapter
    implementation "androidx.concurrent:concurrent-futures:1.1.0"

    // Kotlin
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.6.0"
}
© www.soinside.com 2019 - 2024. All rights reserved.