Just downloaded the newest version of Expo XDE(2.20.1) and trying to convert an existing react native project into it. I followed precisely these steps, and when opening the app in Expo client on a real device, I got an error saying:
undefined is not an object (evaluating 'nativeVersion.major')
The problem happens both on Android and iOS.
Seems expo has a strict requirement of react/react-native versions, but unfortunately, I cannot find the version requirement list.
My current dependencies (which are quite up-to-date) are:
"react": "16.0.0",
"react-native": "0.49.3"
So, does this error indeed came from version conflicts? And if so, how do I solve the problem?
Your JS dependencies need to match the native code. With Expo SDK 21, which is based off of React Native 0.48, you can either use (recommended):
"react": "16.0.0-alpha.12",
"react-native": "https://github.com/expo/react-native/archive/sdk-21.0.2.tar.gz",
or:
"react": "16.0.0-alpha.12",
"react-native": "^0.48.4",
It's important you are careful with the versions when you update your dependencies. The upcoming React Native 0.49 (supported with Expo SDK 22) needs to use React 16.0.0-beta.5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With