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

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

问题描述

我正在使用 react-native-firebase react-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天全站免登陆