升级 Expo SDK
了解如何增量升级项目中的 Expo SDK 版本。
我们建议逐步升级 SDK 版本,一次一个。这样做将帮助你查明升级过程中出现的损坏和问题。
随着新 SDK 的发布,最新版本将进入当前发布状态。这适用于 Expo Go,因为它仅支持最新的 SDK 版本,并且不再支持以前的版本。我们建议将 开发构建 用于生产应用,因为 EAS 服务上旧 SDK 版本的向后兼容性往往会更长,但不会永远持续下去。
¥With a new SDK release, the latest version enters the current release status. This applies to Expo Go as it only supports the latest SDK version and previous versions are no longer supported. We recommend using development builds for production apps as the backwards compatibility for older SDK versions on EAS services tends to be much longer, but not forever.
如果你希望安装特定版本的 Expo Go,请访问 expo.dev/go。它支持 Android 设备/模拟器和 iOS 模拟器的下载。但是,由于 iOS 平台限制,只有最新版本的 Expo Go 可用于在物理 iOS 设备上安装。
¥If you are looking to install a specific version of Expo Go, visit expo.dev/go. It supports downloads for Android devices/emulators and iOS simulators. However, due to iOS platform restrictions, only the latest version of Expo Go is available for installation on physical iOS devices.
如何升级到最新的 SDK 版本
¥How to upgrade to the latest SDK version
1
升级 Expo SDK
¥Upgrade the Expo SDK
安装新版本的 Expo 包:
¥Install the new version of the Expo package:
# Install latest
-
npx expo install expo@latest
# Install a specific SDK version (for example, SDK 52)
-
npx expo install expo@^52.0.0
# Install latest
-
yarn expo install expo@latest
# Install a specific SDK version (for example, SDK 52)
-
yarn expo install expo@^52.0.0
2
3
更新原生项目
¥Update native projects
-
如果你使用 持续的原生生成:如果你在本地项目目录中为以前的 SDK 版本生成了 android 和 ios 目录,请删除它们。下次你使用
npx expo run:ios
、npx expo prebuild
或 EAS Build 运行构建时,它们将被重新生成。¥If you use Continuous Native Generation: Delete the android and ios directories if you generated them for a previous SDK version in your local project directory. They'll be re-generated next time you run a build, either with
npx expo run:ios
,npx expo prebuild
, or with EAS Build. -
如果你不使用 持续的原生生成:如果你有
ios
目录,请运行npx pod-install
。应用 原生项目升级助手 中的任何相关更改。或者,你可以考虑 采用预构建,以便将来更轻松地升级。¥If you don't use Continuous Native Generation: Run
npx pod-install
if you have anios
directory. Apply any relevant changes from the Native project upgrade helper. Alternatively, you could consider adopting prebuild for easier upgrades in the future.
4
请遵循发行说明以获取任何其他说明
¥Follow the release notes for any other instructions
阅读 SDK 变更日志 了解你要升级到的 SDK 版本。它们包含有关重大更改、弃用以及可能影响你的应用的其他更改的重要信息。有关任何其他说明,请参阅发行说明页面底部的 "升级你的应用" 部分。
¥Read the SDK changelogs for the SDK version you are upgrading to. They contain important information about breaking changes, deprecations, and other changes that may affect your app. Refer to tue "Upgrading your app" section at the bottom of the release notes page for any additional instructions.
SDK 变更日志
¥SDK Changelogs
每个 SDK 公告发布说明帖子都包含信息弃用、重大更改以及可能特定于该特定 SDK 版本的其他任何信息。升级时,请务必检查这些内容,以确保不会遗漏任何内容。
¥Each SDK announcement release notes post contains information deprecations, breaking changes, and anything else that might be unique to that particular SDK version. When upgrading, be sure to check these out to make sure you don't miss anything.
-
SDK 52:发行说明
¥SDK 52: Release notes
-
React Native 0.77 可与 Expo SDK 52 一起使用。要升级,请参阅这些 发行说明。
¥React Native 0.77 is available with Expo SDK 52. To upgrade, see these Release notes.
-
-
SDK 51:发行说明
¥SDK 51: Release notes
-
SDK 50:发行说明
¥SDK 50: Release notes
已弃用的 SDK 版本变更日志
¥Deprecated SDK Version Changelogs
以下博客文章可能包含过时的信息,但如果你恰好远远落后于 SDK 升级,它们仍然有用。
¥The following blog posts may included outdated information, but they are still useful for reference if you happen to fall far behind on SDK upgrades.
See a full list of deprecated SDK release changelogs
-
SDK 49:发行说明
¥SDK 49: Release notes
-
SDK 48:发行说明
¥SDK 48: Release notes
-
SDK 47:发行说明
¥SDK 47: Release notes
-
SDK 46:发行说明
¥SDK 46: Release notes
-
SDK 45:发行说明
¥SDK 45: Release notes
-
SDK 44:发行说明
¥SDK 44: Release notes
-
SDK 43:发行说明
¥SDK 43: Release notes
-
SDK 42:发行说明
¥SDK 42: Release notes
-
SDK 41:发行说明
¥SDK 41: Release notes
-
SDK 40:发行说明
¥SDK 40: Release notes
-
SDK 39:发行说明
¥SDK 39: Release notes
-
SDK 38:发行说明
¥SDK 38: Release notes
-
SDK 37:发行说明
¥SDK 37: Release notes
-
SDK 36:发行说明
¥SDK 36: Release notes
-
SDK 35:发行说明
¥SDK 35: Release notes