I just updated React Native to version 0.63.0 and my app breaks when i attempt to login with a real iPhone device, but it works with the simulator.
I started expo, scanned the QR code as usual but when i attempt to login im getting a Network Error.
This is my login function:
const login = () => {
axios.post(`http://localhost:3000/v1/sessions`, login_params)
.then(res => {
if (res.status == 201){
navigation.navigate('Home')
storeData(res.data)
}else {
Alert.alert('Wrong email or password')
}
})
.catch(function(error) {
console.log(error.message);
throw error;
})
}
An i am getting the following error: Network Error
[Unhandled promise rejection: Error: Network Error]
- node_modules/axios/lib/core/createError.js:15:17 in createError
- node_modules/axios/lib/adapters/xhr.js:88:22 in handleError
- node_modules/event-target-shim/dist/event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
- node_modules/react-native/Libraries/Network/XMLHttpRequest.js:600:10 in setReadyState
- node_modules/react-native/Libraries/Network/XMLHttpRequest.js:395:6 in __didCompleteResponse
- node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js:189:10 in emit
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:416:4 in __callFunction
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:109:6 in __guard$argument_0
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:364:10 in __guard
- node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js:108:4 in callFunctionReturnFlushedQueue
- [native code]:null in callFunctionReturnFlushedQueue
I have tried to hard restart expo. Empty caches.
Does any one have an idea of why i am getting Network Error.