react-native在ios中fetch报错处理

TypeError: Network request failed

at XMLHttpRequest.xhr.onerror (fetch.js:408)

at XMLHttpRequest.dispatchEvent (event-target.js:172)

at XMLHttpRequest.setReadyState (XMLHttpRequest.js:478)

at XMLHttpRequest.__didCompleteResponse (XMLHttpRequest.js:324)

at XMLHttpRequest.js:418

at RCTDeviceEventEmitter.emit (EventEmitter.js:179)

at MessageQueue.__callFunction (MessageQueue.js:236)

at MessageQueue.js:108

at guard (MessageQueue.js:46)

at MessageQueue.callFunctionReturnFlushedQueue (MessageQueue.js:107)

处理方法:

用xcode打开info.plist文件,然后添加一个key值

NSAllowsArbitraryLoads


你可能感兴趣的:(react-native在ios中fetch报错处理)