After creating a new monorepo with a package for a new react-native project (0.77.2), the Android build was failing with the following error:
FAILURE: Build failed with an exception.
* Where:
Settings file '<project_name>/packages/<package_name>/android/settings.gradle' line: 2
* What went wrong:
Error resolving plugin [id: 'com.facebook.react.settings']
> Included build '<project_name>/packages/<package_name>/node_modules/@react-native/gradle-plugin' does not exist.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 462ms
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where:
Settings file '<project_name>/packages/<package_name>/android/settings.gradle' line: 2 * What went wrong:
Error resolving plugin [id: 'com.facebook.react.settings']
> Included build '<project_name>/packages/<package_name>/node_modules/@react-native/gradle-plugin' does not exist. * Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org. BUILD FAILED in 462ms.
info Run CLI with --verbose flag for more details.
node:internal/errors:984
const err = new Error(message);
^
Error: Command failed: yarn workspace <package_name> android