【发布时间】:2021-02-12 19:05:25
【问题描述】:
我正在学习国际化如何在 React Native 上发挥作用。为此,我正在使用博览会。 我正在使用这个库: https://github.com/zoontek/react-native-localize
当我在网络浏览器上测试它时,它可以完美运行,但是当我在我的 Android 物理设备上测试它时,它就无法正常工作。显然 react-native-localize 的链接不起作用。我收到此错误:
Error: react-native-localize: NativeModule.RNLocalize is null. To fix this issue try these steps:
• Run `react-native link react-native-localize` in the project root.
• Rebuild and re-run the app.
• If you are using CocoaPods on iOS, run `pod install` in the `ios` directory and then rebuild and re-run the app. You may also need to re-open Xcode to get the new pods.
• Check that the library was linked correctly when you used the link command by running through the manual installation instructions in the README.
• If you are getting this error while unit testing you need to mock the native module. Follow the guide in the README.
• If none of these fix the issue, please open an issue on the Github repository: https://github.com/zoontek/react-native-localize
然后,如果我运行 react-native link react-native-localize,它会显示一条警告,指出它已被弃用并且它不起作用。
在我的 package.json 中,我有这个版本的依赖本地化和 react-native:
"react-native-localize": "^2.0.1",
"react-native": "~0.63.4",
应该自动完成高于 0.60 的 react-native 链接。
如果需要任何进一步的信息,请告诉我。
【问题讨论】:
标签: node.js reactjs react-native localization