跳到主要内容

原生 SDK 版本自定义(Native SDK Version Customization)

警告(Warning):这是高级配置。大多数项目建议使用默认版本。若你手动覆盖版本,后续升级 @rive-app/react-native 时请重新核对兼容性。

默认行为

默认使用包内 package.jsonruntimeVersions

"runtimeVersions": {
"ios": "6.12.0",
"android": "10.4.5"
}

覆盖版本

iOS(Vanilla React Native)

ios/Podfile.properties.json 设置:

{
"RiveRuntimeIOSVersion": "6.13.0"
}

然后执行:

cd ios && pod install

Android(Vanilla React Native)

android/gradle.properties 设置:

Rive_RiveRuntimeAndroidVersion=10.5.0

Expo 项目

可在 app.config.ts 通过 config plugins 写入:

  • RiveRuntimeIOSVersion
  • Rive_RiveRuntimeAndroidVersion

可用版本查询:

版本解析优先级

iOS

  1. ios/Podfile.properties.jsonRiveRuntimeIOSVersion
  2. package.json 的默认版本

Android

  1. android/gradle.propertiesRive_RiveRuntimeAndroidVersion
  2. package.json 的默认版本