Why my React Native Android App build failing?

Issue

I am getting the below error, please check the image.

enter image description here

Solution

I guess the react-native error since Nov 4th, 2022.

Learn more at
https://github.com/facebook/react-native/issues/35210

I think you should update the react-native version

or

add the below code in ‘android/buld.gradle’ file inside allprojects

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())


allprojects {
    configurations.all {
        resolutionStrategy {
            // Remove this override in 0.65+, as a proper fix is included in react-native itself.
            force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
        }
    }

Answered By – Sergey

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published