[iOS 0.29.0]TypeError: Network request failed
TypeError: Network request failed
at XMLHttpRequest.xhr.onerror (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:24437:8)
at XMLHttpRequest.dispatchEvent (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:9960:15)
at XMLHttpRequest.setReadyState (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:25890:6)
at XMLHttpRequest.__didCompleteResponse (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:25748:6)
at http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:25823:52
at RCTDeviceEventEmitter.emit (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:9191:23)
at MessageQueue.__callFunction (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:7279:23)
at http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:7183:8
at guard (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:7131:1)
at MessageQueue.callFunctionReturnFlushedQueue (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:7182:1)
Please tell me ! What can I do something to solve the problem ?
Had same problem, solved by adding
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
to Info.plist
@ksarna This is exactly the solution. Thanks a lot.
@ksarna But it did not work for me.. How can i solve..?
didn't work for me too :(
react-native 0.30.0 node v6.3.1
@facebook-github-bot stack-overflow
Hey @liuhong1happy and thanks for posting this! @grabbou tells me this issue looks like a question that would be best asked on StackOverflow. StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only. Will close this as this is really a question that should be asked on SO.
@ksarna - not working for me either (and I don't see the Stack Overflow thread) is it possible to see a screen shot of your info.plist file? When I edit my info.plist file in raw xml then I can't open in xcode - btw I'm using xcode 7.3, most of the suggestions appear to be a different version
Please someone help me on this issue. I am stuck with the network error. Can' do anything. I have also set the "Allows Arbitrary Loads" to YES.
here is the full strack trace. "TypeError: Network request failed at XMLHttpRequest.xhr.onerror (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:24386:8) at XMLHttpRequest.dispatchEvent (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:9896:15) at XMLHttpRequest.setReadyState (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:25901:6) at XMLHttpRequest.__didCompleteResponse (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:25759:6) at http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:25834:52 at RCTDeviceEventEmitter.emit (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:9127:23) at MessageQueue.__callFunction (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:7207:23) at http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:7108:8 at guard (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:7055:1) at MessageQueue.callFunctionReturnFlushedQueue (http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:7107:1)"
I fixed it by changing those settings via the XCode UI - it didn't work when I changed directly in the plist file
One bad news for developers using NSAppTransportSecurity. 😔
UPDATE: [Apple will require HTTPS connections for iOS apps by the end of 2016] https://techcrunch.com/2016/06/14/apple-will-require-https-connections-for-ios-apps-by-the-end-of-2016/