原生 SDK 版本自定义(Native SDK Version Customization)
警告(Warning):这是高级配置。大多数项目建议使用默认版本。若你手动覆盖版本,后续升级
@rive-app/react-native时请重新核对兼容性。
默认行为
默认使用包内 package.json 的 runtimeVersions:
"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 写入:
RiveRuntimeIOSVersionRive_RiveRuntimeAndroidVersion
可用版本查询:
- Android Releases:https://github.com/rive-app/rive-android/releases
- iOS Releases:https://github.com/rive-app/rive-ios/releases
版本解析优先级
iOS
ios/Podfile.properties.json的RiveRuntimeIOSVersionpackage.json的默认版本
Android
android/gradle.properties的Rive_RiveRuntimeAndroidVersionpackage.json的默认版本