java - 什么可以在不更改代码的情况下破坏 android 构建?

标签 java android react-native google-play-services

我正在开发一个使用 react-native-firebasereact-native 应用程序.我在 travis 上设置了一个 CI 构建,目的是获得可重现的构建,但它突然停止工作,详情如下:

  • > before : 4 天前,构建成功
  • > after : 今天,完全相同的构建被破坏,失败并显示以下消息:

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

解决您的问题

参见 here apply link

Note: Upgrading com.google.android.gms to 17.0.0 will cause many problems.

关于java - 什么可以在不更改代码的情况下破坏 android 构建?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56650057/

相关文章:

java - Webdriver firefox-bin 使用过多的 CPU

java - 未找到虚拟化引擎。插件加载中止

安卓缓存处理

react-native - react-native 导航栏中的侧边菜单

javascript - 基于 redux 状态控制 react 组件的正确方法是什么

react-native - 你如何从 React Native 的 EventEmitter 实例中移除一个监听器?

java - 如何避免 JUnit 测试用例中的继承?

java - java中的window azure身份验证

文件的Java监控文件夹

java - 无法获取澳大利亚日期/时间