Overriding React Native patch version to solve OnePlus crash

  1. SDK Version: v47
  2. Platforms(Android/iOS/web/all): Android

My production Android app is facing a trending crash with OnePlus and OPPO phones which is patched / solved by this change to React Native’s native code: Prevent crash in runAnimationStep on OnePlus and Oppo devices (#37487) · facebook/react-native@c05d822 · GitHub

The change in question is in the patch release 0.70.10 of React Native. My managed Expo app is using SDK v47, which recommends React Native 0.70.8 apparently. Is there a way to get the app to utilize React Native 0.70.10 in order to include that fix, at least for the Android build? Does just changing the version in package.json force the native code bits to 0.70.10? Or is the only option left to eject?


You can just change it, I’m not really sure if it’s still happening on SDK 47, but prebuild might override react-native version, so if you are building on EAS and want to disable that you can add

"prebuildCommand": "prebuild --skip-dependency-update react-native --no-install"

in your eas.json, and it will use the react-native you specified. Of course, when you are overriding it we can’t guarantee that the newer react-native version will work.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.