【发布时间】:2019-04-14 06:39:20
【问题描述】:
所有 gms/firebase 库必须使用完全相同的版本 规范(混合版本可能导致运行时崩溃)。成立 版本 17.1.0、17.0.4、17.0.2、17.0.1、16.2.2、16.0.4、16.0.3、 16.0.2、16.0.1、16.0.0。示例包括 com.google.android.gms:play-services-ads:17.1.0 和 com.google.firebase:firebase-iid:17.0.4 少... (Ctrl+F1)
有一些库或工具和库的组合, 不兼容,或者可能导致错误。一种这样的不兼容性是 使用不支持的 Android 支持库版本进行编译 最新版本(或者特别是低于您的 targetSdkVersion。)
Gradle 依赖如下:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-ads:17.1.0'
implementation 'pub.devrel:easypermissions:1.3.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v13:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:palette-v7:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'jp.wasabeef:recyclerview-animators:2.3.0'
implementation 'com.github.apl-devs:appintro:v4.2.3'
implementation 'com.iarcuschin:simpleratingbar:0.1.5'
}
我尝试使用“play-services-ads”依赖项而不是“firebase-ads”。还尝试添加“firebase-iid”依赖项,但没有运气。 我不确定这是否相关,但如果我看到 gradle 控制台,我会看到此警告“警告:无法解析主机 www-proxy.idc.oracle.com”。 如何正确解决依赖关系?
【问题讨论】:
-
这会将错误显示为警告,但不会影响应用程序。
-
@VishalSharma 目前似乎没有引起问题。但是,我不想冒险,因为这是用于生产应用程序。
-
请don't post your code/error messages as images。首先,我们要复制/粘贴它,其次搜索引擎无法索引该信息。因此,请确保任何文本信息实际上是以文本形式提供的。
-
@lucascaro 你是对的。用错误的文本信息更新了问题。
标签: android firebase android-studio gradle android-gradle-plugin