We changed “expo” version to 48 and “react-native” to https://github.com/expo/react-native/archive/sdk-48.0.0.tar.gz. The version of “react” acceptable to the AWS libraries is 16 while “expo/react-native/archive/sdk-48.0.0.tar.gz” needs 18. This is causing a dependency loop between versions which is not being resolved.
Please could you suggest the versions of the libraries that work with each other correctly. Thank you.
Use npx expo install <package> to install packages, It will pick compatible version for your sdk. Note that it only works for expo packages and some rn packages, most third party rn libraries are not supported and expo install will just run yarn install/npm install
You can try using npx expo upgrade
Make sure to check npx expo-doctor output after upgrading to make sure everything is compatible.
Sdk 34 is very old, upgrading it might not be that easy, some packages that you are using might not be maintained anymore. It might be easier to create new expo app and move your code there.
The version of “react” acceptable to the AWS libraries is 16 while “expo/react-native/archive/sdk-48.0.0.tar.gz” needs 18
So the answer is to rewrite the app using Expo or something else as AWS and Expo don’t work together due to differing versions of react required by the libraries and due to deprecated libraries. Thank you.
In addition to what wkozyra said, you should read through the Expo SDK release blog posts from Expo SDK 35 and Expo SDK 48 to see what was deprecated so that you can make the necessary changes to your code. (See the bottom of this comment for a list of them.)
You don’t have react-native-web installed, so you don’t need react-dom
So this is a Bare workflow app? If you want to switch to the Managed workflow, you can still use react-native-fs, but you will not be able to use Expo Go. Instead, you can create a development build and use that.
If you run expo-cli doctor you it might complain about react-native-gesture-handler depending on which version you actually have installed:
Some dependencies are incompatible with the installed expo package version:
- react-native-gesture-handler - expected version: ~1.3.0 - actual version installed: 1.10.3
If you do decide to give expo-cli upgrade a try, you’ll see something like this:
👏 Automated upgrade steps complete.
...but this doesn't mean everything is done yet!
✅ The following packages were updated:
react, react-dom, react-native, react-native-gesture-handler, babel-preset-expo, expo
🚨 The following packages were not updated. You should check the READMEs for those repositories to determine what version is compatible with your new set of packages:
apollo-client, aws-amplify, aws-amplify-react-native, aws-appsync, aws-appsync-react, aws-sdk, axios, graphql, moment, react-apollo, react-moment, react-native-fs, react-native-modal-datetime-picker, react-native-modalbox, react-native-paper, react-native-sound, react-native-voice, react-navigation
As it says you should check for up to date versions of those dependencies and how to upgrade them. e.g. React Navigation changed quite a bit between version 3 and the current version.
No, I don’t believe this is correct. The AWS Amplify documentation seems to be up to date with recent versions of Expo, so you probably just need to update the aws-* dependencies to recent versions.
This should give you an idea of what probably needs to be updated. But don’t just blindly upgrade to the versions shown here. e.g. React Navigation is now up to version 6.x, but in order to upgrade to that version you would need to uninstall the react-navigation package and install the packages specified in their documentation instead (and then make the necessary changes to the code).