React Native开发React Native开发经验集React Native实践

Firebase引用版本冲突解决:Android depende

2019-03-05  本文已影响5人  Huangrong_000

What went wrong:
Execution failed for task ':app:preDebugBuild'.
Android dependency 'com.google.android.gms:play-services-basement' has different version for the compile (16.0.1) and runtime (16.1.0) classpath. You should manually set the same version via DependencyResolution
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org

尝试

1. 方法一:

allprojects {
    subprojects {
            project.configurations.all {
                resolutionStrategy.eachDependency { details ->
                    if (details.requested.group == 'com.android.support'
                            && !details.requested.name.contains('multidex') ) {
                        details.useVersion "16.1.0"
                    }
                }
            }
        }
}

2. 方法二:

classpath 'com.google.gms:google-services:4.0.2' // Just updated the version here.

3. 方法三:

解决方法

第一步:

第二步:

implementation ('com.google.firebase:firebase-core:16.0.6') { // 所加的第三方框架
        exclude group: 'com.google.android.gms',module: 'play-services-basement'     // 加载时排除框架中的design包
    }
上一篇 下一篇

猜你喜欢

热点阅读