什么可以在不更改代码的情况下破坏 android 构建? [英] What can break an android build without code changes?

查看:36
本文介绍了什么可以在不更改代码的情况下破坏 android 构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am working on a react-native app that uses react-native-firebase. I've setup a CI build on travis with the aim to have reproducible builds, and it has suddenly stopped working, as detailed here:

  • 之前:4 天前,构建工作
  • 之后:今天,完全相同的构建被破坏了,失败并显示以下消息:
  • before: 4 days ago, the build works
  • after: today, the exact same build is broken, failing with the following message:

Android 依赖项 'com.google.android.gms:play-services-base' 对于编译 (16.0.1) 和运行时 (17.0.0) 类路径具有不同的版本.您应该通过 DependencyResolution 手动设置相同的版本

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 构建,无法弄清楚发生了什么或为什么会发生.

My only reasonable guess is that some dependency has changed, but I don't understand android builds well enough to figure out what has happened or why.

很明显,我如何防止将来发生此类意外?(在我看来,这个构建应该是完全可重复的)

And obviously, how do I prevent such surprises from happening in the future? (in my mind, this build should be perfectly repeatable)

作为旁注,当构建失败时,它还会显示几个警告,例如:

As a side note, when the build fails, it also shows several warnings like:

警告:与项目:app"中的依赖项com.google.android.gms:play-services-base"冲突.运行时类路径 (17.0.0) 和编译类路径 (16.0.1) 的已解析版本不同.这可能会导致运行时崩溃.要解决此问题,请遵循 https://developer 上的建议.android.com/studio/build/gradle-tips#configure-project-wide-properties.或者,您可以尝试通过将此代码段添加到/home/travis/build/mapswipe/mapswipe/android/app/build.gradle 来解决问题:依赖{实现(com.google.android.gms:play-services-base:17.0.0")}

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") }

但遵循该建议只会导致更多(不同的)错误.

but following that advice only causes further (different) errors.

推荐答案

根本原因是相关迁移到Androidx,google play服务更新到androidX

The root cause is related migration to Androidx, google play service updated to androidX

如果您使用的是real-native-info,请升级.它将用 2.1.2

If you are using real-native-info, please upgrade. It will solve your problem with 2.1.2

请参阅此处申请链接

注意:将 com.google.android.gms 升级到 17.0.0 会导致很多问题.

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

这篇关于什么可以在不更改代码的情况下破坏 android 构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆