Android 14 (SDK 34) support for React Native ver <=0.69.x

Hitesh Jha
2 min readMar 5, 2024

--

Problem statement: https://github.com/facebook/react-native/issues/41288

My React Native v0.67.4 app codebase works fine with android 13 (SDK 33)

But when I try to upgrade for Android 14 (SDK 34) my code broke

React Native code maintainers have stopped support for Android 14 (SDK 34)

for React Native’s archived versions below v0.69.0 (https://reactnative.dev/versions)

When searched for the solution I found a patch to apply in DevSupportManagerBase.java file to support Android 14 (SDK 34) in this version of React Native

node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java

https://github.com/facebook/react-native/pull/38256/commits/f14da92d6c082ed21540ef2e1da6622d27a5400c

But here is an issue, this patch is not directly applicable into React Native node modules

Because React Native takes its Java dependency as an AAR archive and any changes to node modules will be skipped.

So what to do to make it work for your project?

I tried the solution below and it worked fine for me.

Apply above patch, then go inside your React Native project and run below command (for MAC OS) to generate AAR archives with the applied patch

cd android && ./gradlew ReactAndroid:installArchives

This will generate AAR archives inside below folder

node_modules/react-native/android/com/facebook/react/react-native/0.67.4/…

Now you have the Android 14 supported version of React Native.

Tip: You can save these AAR archives and replace in your project’s node_modules/react-native/android/com/facebook/react/react-native

--

--

Hitesh Jha

Android | React Native | Mobile Application Developer