react-native - React Native:使用 react-native-fs 时出现异常
问题描述
这是使用 React-native-fs 时的错误。我正在使用 expo 创建我的项目而没有分离,并尽量不分离。我想从 react-native 模块读取从 CameraRoll 中的 getPhotos 检索到的 content:// 图像作为文件路径。是不是因为我没有分离我的应用程序。有没有办法使用 expo 来检索图像的文件路径。
解决方案
You should link project react-native link react-native-fs or manual linking android/settings.gradle ... include ':react-native-fs' project(':react-native-fs').projectDir = new File(settingsDir, '../node_modules/react-native-fs/android') android/app/build.gradle ... dependencies { ... compile project(':react-native-fs') }
添加包 .addPackage(new RNFSPackage())
然后生成新版本
推荐阅读
- nativescript - Nativescript Vue:当数据更改时,RadListView 不刷新
- c++ - 在 getline 之前进行字符串流初始化的原因是什么,但反过来却不行?
- c - 程序一直打印一个零字节?
- android - Android Studio:房间:错误:找不到字段的吸气剂
- sql-server - 从 VB.NET 中的 SQL Server 返回布尔值
- java - 如何将固定字符串值作为短信发送?
- django - 尝试注销时的 Django NoReverseMatch
- scala - Scala 模棱两可的案例类生成和伴随的应用方法
- java - 如何解决我的代码中的“不是功能接口”问题
- apache-spark - 使用苏打水训练和部署模型