React Native Android构建的可能会发生变化的依赖项是什么?

huangapple go评论68阅读模式
英文:

What are the dependencies of a React Native Android build that are subject to change?

问题

我有一个React Native应用,我为iOS和Android都构建了它。代码或我们的CI系统没有任何更改,但由于某种原因,Android构建周期性地停止工作,我不得不在build.gradle中进行一些调整才能修复它。

另一方面,只要Xcode的版本保持不变,iOS构建就没有问题。

我想知道Android构建的依赖的哪些部分可能会发生变化,以及如何锁定它们到特定的版本?

英文:

I have a React Native app that I build for both iOS and Android. Nothing changes in the code or our CI system, but for some reason, the Android build periodically stops working and I'll have to make some adjustments to the build.gradle in order to fix it.

The iOS build, on the other hand, has no problems as long as the version of Xcode stays the same.

I'm wondering what part of the Android build's dependencies are subject to change and how can I lock them to specific versions?

答案1

得分: 2

需要定期更新您的应用程序以跟上您使用的代码中的安全性/错误修复。操作系统定期更新,Android 或 iOS 的更改也可能需要您进行更新。您无法预测这些公司会做什么。

默认情况下,您的包/库不会自动更新。您需要在 package.json 依赖列表中的版本号前添加 ^ 符号。这将使它们保持更新到最新的次要版本,因为任何主要更新都会引入破坏性更改(需要您更改一些代码)。

英文:

You need to periodically update your app to keep up with security/bug fixes in the code you use. The operating system regularly gets updated and changes to Android or iOS may require you to update as well. You can't predict what these companies do.

By default, your packages/libraries do not update themselves. You'll have to add ^ at the beginning of their version number in package.json dependency list. That'll keep them updated to the latest minor version, as any major update would introduce breaking changes (which requires you to change some code.)

huangapple
  • 本文由 发表于 2023年6月15日 21:00:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/76482748.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定