If you are using expo, execute below command
"expo upgrade"
this will upgrade/downgrade the package versions as per the supported versions.
if you tryed to upgrade app to sdk 41 or above this mite help
https://github.com/expo/react-native/archive/sdk-40.0.0.tar.gz