Resolving "Plugin [id: 'com.facebook.react.settings'] not found" in React Native
Upgrading React Native to version 0.75.1 or later often triggers the error: Plugin [id: 'com.facebook.react.settings'] was not found
. This error occurs during Android builds and stems from Gradle's inability to locate the required React Native plugin. This article provides proven solutions based on community-tested approaches.
Critical Prerequisites
- Ensure all dependencies in
package.json
use semver notation (e.g.,^0.75.1
instead of0.75.1
) - Verify
react-native-windows
version matches your React Native version if used - Confirm Java JDK and Android Studio installations are current
Primary Solutions
1. Verify and Install the Correct Gradle Plugin Version
Incompatible or missing @react-native/gradle-plugin
is the #1 cause.
Step-by-Step Fix:
# Install exact version matching your React Native
npm install @react-native/gradle-plugin@0.75.1 --exact --save-dev
# OR with yarn
yarn add @react-native/gradle-plugin@0.75.1 --exact --dev
# Clean project artifacts
rm -rf node_modules android/.gradle
rm package-lock.json # or yarn.lock
# Reinstall dependencies
npm install
# Clean and rebuild Android
cd android
./gradlew clean
2. Update Gradle Plugin Repositories
Explicitly declare repositories in android/settings.gradle
:
pluginManagement {
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
includeBuild("../node_modules/@react-native/gradle-plugin")
}
plugins {
id("com.facebook.react.settings")
}
// Rest of your settings.gradle...
3. Clean Gradle Cache and Rebuild
Stale Gradle caches frequently cause this error:
cd android
./gradlew --stop # Stop existing Gradle daemons
rm -rf .gradle # Delete Gradle cache
./gradlew clean # Clean project
./gradlew assembleDebug # Rebuild without Metro
4. Verify Environment Variables (Windows-Specific)
Improper Java paths are common on Windows:
- Set
JAVA_HOME
to Android Studio's JDK path:iniJAVA_HOME=C:\Program Files\Android\Android Studio\jbr
- Add to system
Path
:ini%JAVA_HOME%\bin
- Restart your IDE and terminal.
Secondary Solutions
Try these if primary solutions fail:
Force Dependency Resolution
npx react-native doctor --fix
Update Gradle Version (if errors persist)
In android/build.gradle
:
buildscript {
ext {
gradlePluginVersion = "8.1.2" # Updated version
# Other versions...
}
// ...
}
Windows Dependency Refresh
.\android\gradlew.bat build --refresh-dependencies
Common Pitfalls to Avoid
- Multiple lock files: Delete stray
package.json
/package-lock.json
in parent directories - Mismatched plugin versions: Verify all references to
com.facebook.react
use the same version - VS Code interference: Disable Java extensions temporarily during builds
- Inconsistent dependencies: Run
npx react-native doctor
to detect environment issues
Key Maintenance Practices
- Always use
npm install
instead ofnpm start
after dependency changes - Verify
settings.gradle
exactly matches the React Native Upgrade Helper - Regularly run
./gradlew clean
before major builds
After applying these fixes, rebuild your project with npm run android
. The solutions combine plugin management best practices with environment cleanup - addressing >90% of reported cases. For persistent issues, consult React Native's GitHub issues #46046.