我正在开发一个使用 react-native-firebase 的 react-native
应用程序.我在 travis 上设置了一个 CI 构建,目的是获得可重现的构建,但它突然停止工作,详情如下:
Android dependency 'com.google.android.gms:play-services-base' has different version for the compile (16.0.1) and runtime (17.0.0) classpath. You should manually set the same version via DependencyResolution
我唯一合理的猜测是某些依赖关系发生了变化,但我对 android 构建的了解不够深入,无法弄清楚发生了什么或为什么。
显然,我该如何防止此类意外在未来发生? (在我看来,这个构建应该是完全可重复的)
作为旁注,当构建失败时,它还会显示一些警告,例如:
WARNING: Conflict with dependency 'com.google.android.gms:play-services-base' in project ':app'. Resolved versions for runtime classpath (17.0.0) and compile classpath (16.0.1) differ. This can lead to runtime crashes. To resolve this issue follow advice at https://developer.android.com/studio/build/gradle-tips#configure-project-wide-properties. Alternatively, you can try to fix the problem by adding this snippet to /home/travis/build/mapswipe/mapswipe/android/app/build.gradle: dependencies { implementation("com.google.android.gms:play-services-base:17.0.0") }
但遵循该建议只会导致更多(不同的)错误。
最佳答案
根本原因与迁移到Androidx有关,google play服务更新到androidX
如果您使用的是real-native-info
,请升级。它将用 2.1.2
Note: Upgrading
com.google.android.gms
to 17.0.0 will cause many problems.
关于java - 什么可以在不更改代码的情况下破坏 android 构建?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56650057/