gpt4 book ai didi

ios - React Native Fetch Blob - undefined 不是对象(评估 'RNFetchBlob.DocumentDir' )

转载 作者:可可西里 更新时间:2023-11-01 03:50:52 25 4
gpt4 key购买 nike

免责声明

已经查看了 wiki 的故障排除页面,但是我仍然无法解决我遇到的问题。

RN 版本:

react-native-cli: 2.0.1
react-native: 0.43.4

我的代码:

从“react-native-file-uploader”导入 FileUploader

<Button
onPress={() => RNFetchBlob.fetch('POST', 'http://localhost:8000/upload', {
'Content-Type' : 'application/octet-stream'
}, RNFetchBlob.wrap('./tempImageStore/image.jpg'))
}
title={'Upload File'}
/>

我得到的错误:

simulator screen shot may 7 2017 11 04 09 am

我为安装 react-native-fetch-blob 做了什么:

1) npm install --save github:wkh237/react-native-fetch-blob-package#master
2) react-native 链接

背景信息:

  • 我尝试使用 import RNFetchBlob from 'react-native-fetch-blob'var RNFetchBlob = require('react-native-fetch-blob').default 导入它
  • 我已经尝试使用上面的代码和 npm install --save react-native-fetch-blob
  • 安装它
  • 我正在 IOS 模拟器上尝试这个。

预先感谢您的帮助!

最佳答案

链接后你需要运行

pod update

在 ios 文件夹内

关于ios - React Native Fetch Blob - undefined 不是对象(评估 'RNFetchBlob.DocumentDir' ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43835848/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com