嗨,这可能是一个愚蠢的问题,但我真的很困惑如何使用rn-fetch-blob!https://github.com/joltup/rn-fetch-blob发送包含主体中项目的POST请求
下面是我的POST请求代码,但它抛出了一个"Unable to symbolicate : the stack is null“
const data = 'guid='+guid+'&username='+username+'&pass='+password;
let response = await RNFetchBlob.config({ trusty: certificate })
.fetch('POST', httpOrhttps + "://" + ipAddress + ":" + portNumber +
"/setup/", RNFetchBlob.base64.encode(data))
.catch(async (error) => { console.error(error); });然而,我的GET post工作得很好。
let response = await RNFetchBlob.config({ trusty: certificate})
.fetch('GET', httpOrhttps + "://" + ipAddress + ":" + httpPort + "/setup/guid=" + guid
+ "&username=" + username + "&pass=" + password)
.catch(async (error) => { console.error(error); });依赖关系:
"dependencies": {
"@react-native-community/async-storage": "^1.11.0",
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/bottom-tabs": "^5.7.1",
"@react-navigation/drawer": "^5.8.5",
"@react-navigation/material-bottom-tabs": "^5.2.13",
"@react-navigation/native": "^5.7.0",
"@react-navigation/stack": "^5.7.0",
"react": "16.13.1",
"react-native": "0.63.1",
"react-native-device-info": "^5.6.3",
"react-native-dropdown-picker": "^3.1.11",
"react-native-elements": "^2.0.4",
"react-native-gesture-handler": "^1.6.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-paper": "^4.0.0",
"react-native-reanimated": "^1.9.0",
"react-native-safe-area-context": "^3.1.1",
"react-native-screens": "^2.9.0",
"react-native-vector-icons": "^7.0.0",
"rn-fetch-blob": "^0.12.0"
},发布于 2020-07-31 04:36:23
Ciao,很难理解为什么,但最重要的是这个错误发生在哪里(我的意思是,肯定发生在rn-fetch-blob中,但确切地说是在哪里)。我这么说是因为,观察react native ExceptionsManager.js code,在函数reportException中,如果没有接收prettyStack,它将返回The stack is null (所以我们没有要分析的堆栈)。
我找到了this,但太旧了,除了3个众所周知的命令之外,没有其他解决方案:
rm -rf ~/.rncache
watchman watch-del-all
npm start -- reset-cache你可能已经试过了。
另一件事:您有最新版本的rn-fetch-blob。您可以尝试降级到10或11 (您可以这样做,因为您有原生的react 0.63)。
就这样。如果我会找到其他线索,我会在这个答案上添加一个评论。
https://stackoverflow.com/questions/63178696
复制相似问题