Ios React Native enoint:没有这样的文件或目录,打开';资产-library://asset/asset.jpg' 在Xcode中

Ios React Native enoint:没有这样的文件或目录,打开';资产-library://asset/asset.jpg' 在Xcode中,ios,xcode,react-native,react-native-ios,Ios,Xcode,React Native,React Native Ios,您好,在我的react native应用程序中使用react native fs从iPhone上传图片时。我正在犯错误 如何解决上述问题。我通过在文件中添加这行代码来解决上述问题 import React,{Component}来自'React'; 进口{ 样式表, 文本, 看法 }从“反应本机”; 从“react native Camera”导入相机; 从“react native fs”导入RNF; 导出默认类应用程序扩展组件{ render(){ 返回( 欢迎{this.props.n

您好,在我的react native应用程序中使用react native fs从iPhone上传图片时。我正在犯错误


如何解决上述问题。

我通过在文件中添加这行代码来解决上述问题

import React,{Component}来自'React';
进口{
样式表,
文本,
看法
}从“反应本机”;
从“react native Camera”导入相机;
从“react native fs”导入RNF;
导出默认类应用程序扩展组件{
render(){
返回(
欢迎{this.props.navigation.getParam('FirstName','')}
{
这个摄像头=凸轮;
}}
类型={'front'}
style={style.preview}
aspect={Camera.constants.aspect.fill}
captureQuality={Camera.constants.captureQuality.low}
captureTarget={Camera.constants.captureTarget.disk}
>
{
this.props.navigation.getParam('LogType','')&&
在里面
}
{!this.props.navigation.getParam('LogType','')&&
出来
}
);
}
拍照{
this.camera.capture()
。然后((数据)=>
this.ServiceCall(数据)
)
.catch(err=>console.error(err));
}
}
const styles=StyleSheet.create({
容器:{
弹性:1,
背景颜色:“白色”
},
标题:{
弹性:1,
对齐自我:“中心”,
尺寸:30,
颜色:'黑色',
背景颜色:“白色”
},
标题栏:{
flexDirection:'行',
背景颜色:“白色”,
paddingTop:10,
填充底部:10,
填充左:5
},
按钮容器:{
flexDirection:'行',
},
预览:{
弹性:1,
justifyContent:“柔性端”,
对齐项目:“中心”
},
在:{
尺寸:30,
背景颜色:“绿色”,
marginBottom:20,
填充:20,
颜色:'白色',
边界半径:10,
textAlign:“中心”
},
输出:{
尺寸:30,
填充:20,
背景颜色:“红色”,
marginBottom:20,
颜色:'白色',
边界半径:10,
textAlign:“中心”
},
});