Just add
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
and related stuff
in e.g. react-native-maps/android/build.gradle ref to https://github.com/react-native-maps/react-native-maps/blob/master/android/build.gradle