79652742

Date: 2025-06-04 12:24:15
Score: 0.5
Natty:
Report link

After a few tries I found this blog post, the configuration it suggests did not work on my project, however it had insights about the location of node_modules (it is a couple of folders above what it "should be", i.e. an extra ../../) .
After some modifications I got it working:

packages/<package_name>/android/settings.gradle - add extra ../../:

pluginManagement { includeBuild("../../../node_modules/@react-native/gradle-plugin") }
...
includeBuild('../../../node_modules/@react-native/gradle-plugin')

packages/<package_name>/android/app/build.gradle - modify the default locations and add extra ../../:

...
reactNativeDir = file("../../../../node_modules/react-native")
...
codegenDir = file("../../../../node_modules/@react-native/codegen")
...
Reasons:
  • Blacklisted phrase (1): this blog
  • Blacklisted phrase (1): did not work
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • High reputation (-1):
Posted by: MikeL