我正在尝试将 react-native-device-info
集成到我的项目中,当我安装模块并链接它时,会出现如下错误
```
* What went wrong:
Execution failed for task ':app:preDebugBuild'.
> Android dependency 'com.google.android.gms:play-services-base' has different version for the compile (15.0.1) and runtime (16.0.1) 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
BUILD FAILED in 6s
13 actionable tasks: 1 executed, 12 up-to-date
```
当我手动配置项目时,会出现相同的错误。但是当我取消链接 react native 设备信息时,项目运行良好。
最佳答案
将此 block 添加到 app/build.gradle
文件中的 buildTypes{}
block 下方并再次运行应用
configurations.all {
resolutionStrategy {
force 'com.google.android.gms:play-services-base:16.0.1'
}
}
关于javascript - 安装和实现 react native 设备信息时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53754594/