React-device-info 问题在 expo 和 ui-kitten
React-device-info issue in expo and ui-kitten
大家早上好,
I'm having an issue using expo and ui-kitten. I'm pretty much familiar
with react-native-element as UI library for react native. But I found
out that ui-kitten has some stunning features for theming and styling
in react-native, expo and I follow this link
https://github.com/akveo/react-native-ui-kitten explained by
https://justinnoel.dev/2019/12/21/create-universal-react-native-apps-using-expo-for-web-and-ui-kitten.
在应用程序的目录中,我有常规的 expo 文件夹和 ui-kitten 组件依赖的另一个文件夹 src。
但是当尝试使用 ui-kitten 词汇表设计我的应用程序时,我被要求安装由 node-module 中的组件使用的 @react-native-community/react-device-info。
当我在应用程序中使用 DateFns 来解析和格式化日期时出现问题。安装@ui-kitten/date-fns 最终出现此错误“Error @react-native-community/react-device-info : NativeModule.RNDevice is null”。我通过堆栈跟踪尝试了建议的步骤:
- To link react-device-info to react-native 如果我的反应本机版本
<=0.59,但我的是 0.61.4
- 如果我使用的是 cocoa pod,则安装 pod,但我没有。
- 要重建和 re-run(我重建并 re-run 使用相同的步骤和
得到相同的结果)。
屏幕在这里
那么我该如何修复这个错误,我似乎不知道它是来自 expo 的依赖项还是来自 ui-kitten 模块内部的错误,或者两者之间的冲突。
任何帮助将不胜感激!
这是我的背景:
- 主要目标是使用 ui-kitten 和 expo 功能
- 我运行 android 模拟器上的应用程序
- 安装 date-fns 后出现问题。世博会无法从设备中检索日期时间或日历等本机数据吗?如何解决这个问题。
提前致谢。
UI Kitten 与 react-native-device-info
没有共同点。如果您没有使用 Expo,您应该完全按照错误提示进行操作:link the library.
如果您这样做,请参阅此软件包的 Expo implementation。
有两种方法可以解决此问题,即退出 expo 或重新构建ui另一个应用程序。事实上,expo 不支持设备时间或地理定位等本机模块,我只是忘记了。也就是说,将设备的属性与 expo 一起使用是不可行的。
所以第一种方法是通过 运行 expo eject 来弹出 expo。但它跨越了边界,世博会有一些关于依赖和部署的设施。因此,最好的选择是使用 ui-kitten 重新 uild 另一个 expo 应用程序,但避免使用 react-native 和 ui-kitten 调用设备信息的任何功能,然后部署添加需要ui设备功能的应用程序功能,例如摄像头、地理位置或设备的日期和时间。
大家早上好,
I'm having an issue using expo and ui-kitten. I'm pretty much familiar with react-native-element as UI library for react native. But I found out that ui-kitten has some stunning features for theming and styling in react-native, expo and I follow this link https://github.com/akveo/react-native-ui-kitten explained by https://justinnoel.dev/2019/12/21/create-universal-react-native-apps-using-expo-for-web-and-ui-kitten.
在应用程序的目录中,我有常规的 expo 文件夹和 ui-kitten 组件依赖的另一个文件夹 src。 但是当尝试使用 ui-kitten 词汇表设计我的应用程序时,我被要求安装由 node-module 中的组件使用的 @react-native-community/react-device-info。 当我在应用程序中使用 DateFns 来解析和格式化日期时出现问题。安装@ui-kitten/date-fns 最终出现此错误“Error @react-native-community/react-device-info : NativeModule.RNDevice is null”。我通过堆栈跟踪尝试了建议的步骤:
- To link react-device-info to react-native 如果我的反应本机版本 <=0.59,但我的是 0.61.4
- 如果我使用的是 cocoa pod,则安装 pod,但我没有。
- 要重建和 re-run(我重建并 re-run 使用相同的步骤和
得到相同的结果)。
屏幕在这里
那么我该如何修复这个错误,我似乎不知道它是来自 expo 的依赖项还是来自 ui-kitten 模块内部的错误,或者两者之间的冲突。 任何帮助将不胜感激!
这是我的背景:
- 主要目标是使用 ui-kitten 和 expo 功能
- 我运行 android 模拟器上的应用程序
- 安装 date-fns 后出现问题。世博会无法从设备中检索日期时间或日历等本机数据吗?如何解决这个问题。
提前致谢。
UI Kitten 与 react-native-device-info
没有共同点。如果您没有使用 Expo,您应该完全按照错误提示进行操作:link the library.
如果您这样做,请参阅此软件包的 Expo implementation。
有两种方法可以解决此问题,即退出 expo 或重新构建ui另一个应用程序。事实上,expo 不支持设备时间或地理定位等本机模块,我只是忘记了。也就是说,将设备的属性与 expo 一起使用是不可行的。 所以第一种方法是通过 运行 expo eject 来弹出 expo。但它跨越了边界,世博会有一些关于依赖和部署的设施。因此,最好的选择是使用 ui-kitten 重新 uild 另一个 expo 应用程序,但避免使用 react-native 和 ui-kitten 调用设备信息的任何功能,然后部署添加需要ui设备功能的应用程序功能,例如摄像头、地理位置或设备的日期和时间。