If you're using react-native expo you can run the command
npx expo install the-expo-package
This will fix almost every issue with the package version. This is because expo will automatically determine the suitable version.