androidreact-nativegradlesymbolsbuildconfig

MainActivity.java - cannot find symbol reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED)


I've upgraded react-native to latest version (0.68) through react-native CLI, and now every time I'm trying to build for android I get this error: error: cannot find symbol reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);

I tried to clean the bundle, made sure my package name is correct (like others issues suggested) and nothing so far..


Solution

  • Going through react-native migrations file, I've found out that somehow I missed a few migrations related to react-native new architecture (although I would expect it to be automatic when using react-native CLI upgrade command).

    I suggest to follow the migrations changes especially on MainActivity.java and MainApplication.java - don't forget to change the "from" and "to" versions to your case:

    https://react-native-community.github.io/upgrade-helper/?from=0.65.1&to=0.68.1