Error Resolving Plugin [id: ‘com.facebook.react.settings’]
Error resolving plugin [id: ‘com.facebook.react.settings’] can appear with a Gradle workspace-move failure; read the nested error before changing the plugin ID. The key is the nested error: if it says Could not move temporary workspace and to immutable location, Gradle has failed while updating its local cache. If Gradle instead says the plugin cannot be found or the included React Native Gradle build is missing, investigate the project template and installed dependencies.
Use this table to choose the right repair before editing android\settings.gradle.
| Symptom in the full error output | Likely cause | First fix |
|---|---|---|
Could not move temporary workspace followed by to immutable location |
Project-local Gradle metadata that could not be moved from its temporary workspace to an immutable location | Stop Gradle, delete android\.gradle, and rebuild |
Settings file ... android\settings.gradle line: 2 plus a workspace move error |
Gradle surfaced the failure where the settings plugin was requested | Treat the workspace move error as the immediate cause |
| Plugin is “not found,” or the React Native Gradle plugin directory is missing | node_modules, the settings file, and the installed React Native version do not match |
Restore the matching React Native template and reinstall dependencies |
| Manual changes to Android or React Native files | A partial upgrade or copied Gradle configuration | Compare the project with the template for the exact installed React Native release |
What the React Native Settings Plugin Error Means
com.facebook.react.settings is a Gradle settings plugin used by current React Native Android projects. Gradle evaluates settings.gradle before it builds the Android app, so a failure there can stop the entire build before compilation begins.
The important distinction is between the place Gradle reports and the actual operation that failed. Build output may identify android\settings.gradle line: 2 because that is where Gradle tries to resolve the plugin. Line 2 was the location shown, but the deeper exception was a failure to move a temporary Gradle workspace.
The deepest nested exception is the cause to fix; the plugin-resolution line is often only the place Gradle surfaced it.
Read the error from the first What went wrong section through its final nested exception. The cache-repair method applies when the nested exception includes both phrases:
java.io.UncheckedIOException: Could not move temporary workspaceto immutable location
Those messages mean Gradle created temporary dependency-accessor metadata but could not replace or finalize its cached copy. Changing com.facebook.react.settings in response can turn a recoverable cache problem into a real React Native configuration problem.
How to Fix the Workspace Move Failure
Removing the affected project-local android\.gradle cache after stopping Gradle lets the Android build recreate its dependency-accessor files.
Step 1: Identify the Actual Failing Path
- Open the complete Android build output rather than reading only the first red error line.
- Confirm that the nested exception contains
Could not move temporary workspaceandto immutable location. - Note the project path named in the exception.
A Windows failure used a cache path under:
android\.gradle\8.8\dependencies-accessors
The 8.8 portion is part of the reported directory path, so use the complete path printed in your own error. Use the project path and Gradle version printed after Could not move temporary workspace.
At this stage, do not downgrade React Native or remove your entire Android directory.
Step 2: Stop Gradle and Remove Only the Project-Local Cache
Close Android Studio and any terminal currently running an Android build for this project. Stopping the Gradle daemon first reduces the chance that Windows, macOS, or Linux still has the workspace open.
From the project root, run the following cache-removal commands in the shell that matches your operating system.
In Windows PowerShell:
Set-Location .\android
.\gradlew.bat --stop
Remove-Item -Recurse -Force .\.gradle
Set-Location ..
In macOS or Linux shells:
cd android
./gradlew --stop
rm -rf .gradle
cd ..
This removes only generated Gradle state inside the affected project’s android directory. Do not delete the project’s android folder, source files, Gradle wrapper files, or its global Gradle cache as the first response.
Step 3: Rebuild From the Project Root
Run the Android script from the repository root if the project uses npm:
npm run android
Gradle should recreate android\.gradle and its dependency-accessor files. A successful repair gets past settings evaluation and proceeds to the normal Android build, install, or emulator-launch stage.
If you normally start Metro separately, you can also start it as usual and choose Android from its prompt. The key test is that the Android build no longer stops while resolving com.facebook.react.settings.
Step 4: Handle a Folder That Is Still Locked
If the local .gradle folder cannot be deleted or the same move error immediately returns:
- Fully exit Android Studio, Metro terminals, and terminals opened in that project.
- Check whether a file-syncing tool, indexing tool, or security scanner is actively using the project directory.
- Restart the computer if the folder remains locked after closing those tools.
- Delete only the project-local
android\.gradlefolder again. - Rebuild from the repository root.
npm run android
A project stored in a normal local development folder is less likely to have its Gradle metadata changed or locked while Gradle is replacing temporary workspace files.
When the Plugin Declaration Is Actually the Problem
The cache fix is not the right answer when the nested workspace-move exception is absent. Treat this as a React Native project-configuration problem when the output instead indicates that Gradle cannot locate the plugin, cannot find the included React Native Gradle build, or cannot access the dependencies required to resolve it.
Signs of a Template or Dependency Mismatch
Common warning signs include:
android\settings.gradlewas copied from a different React Native project or tutorial.- React Native was upgraded or downgraded without completing the corresponding Android project changes.
node_modulesis missing, partially installed, or inconsistent with the lockfile.- The React Native Gradle plugin package expected by the settings file is not present under
node_modules. - A new Android directory was added to an existing JavaScript project using files from an unrelated React Native release.
Do not replace your settings.gradle with a random snippet from a forum post. React Native’s Android template, Gradle plugin wiring, and autolinking configuration need to match the React Native version installed in that repository.
Repair a Mismatched React Native Android Setup
- Save or commit your current Android changes so you can distinguish local customization from generated template files.
- Check the React Native version recorded in the project manifest and lockfile.
- Compare
android\settings.gradlewith the Android template for that exact React Native release. - Restore the plugin-management and settings configuration from the matching template while preserving intentional app-specific changes.
- Reinstall JavaScript dependencies from the repository’s lockfile. For an npm project with a
package-lock.json, use:
npm ci
- After restoring the matching configuration, stop Gradle and remove the project-local android\.gradle directory before rebuilding:
npm run android
If the settings file has extensive manual edits, restoring only the relevant template sections is safer than replacing every Android file. If the Android setup is heavily out of sync, regenerating a clean native project for the same React Native version and carefully transferring app configuration can be more reliable than trying to merge unrelated Gradle files.
Compare React Native Template and Version Context
A version difference can matter even when the visible error text is identical. One documented case involved a newly created React Native 0.75.2 project while another project using 0.74.3 built successfully. That comparison alone does not identify why the newer project failed.
When reproducing or comparing the original setup, one reported project was created with:
npx @react-native-community/cli init TodoApp2 --directory ./native-cli-todo-app-2
Use the command and directory used to create the affected project when documenting the problem. A fresh command run today may resolve newer dependencies than it did when the failing project was created, so it is not a like-for-like comparison unless the React Native version and lockfile are also aligned.
Compare these items between a working project and a failing one:
- The installed
react-nativeversion - The lockfile and package manager
android\settings.gradle- The presence of the React Native Gradle plugin under
node_modules - The Gradle wrapper and Android build configuration
- Whether the failing project was created, upgraded, or copied differently
Avoid copying only one Gradle file from a working project. Native Android configuration files are connected: a settings file that works for one React Native template can be wrong for another.
Confirm the Repair and Avoid Repeat Failures
The repair is complete when Gradle passes the settings phase without the plugin-resolution error and continues into the normal Android build. Confirm that the build no longer contains either the temporary-workspace move failure or the immutable-location message.
Before moving on:
- Keep
android\settings.gradle, the package manifest, and the lockfile under version control. - Leave generated project-local
.gradlefiles untracked. - If the failure returns, capture the full nested exception, including the temporary and destination paths, rather than sharing only the plugin ID.
The exact workspace-move pattern has been recorded in the React Native issue tracker. If deleting the project-local cache does not resolve it, include the complete error, React Native version, Gradle version, operating system, project location type, and project-creation command in a new report or issue update.
Frequently Asked Questions
Why does Gradle point to android\settings.gradle line 2?
Gradle points there because line 2 is often where the settings plugin is requested, not necessarily because the plugin declaration is invalid. If the same error includes Could not move temporary workspace, the immediate failure is Gradle’s attempt to move generated cache metadata. Read the final nested exception before modifying the settings file.
Is it safe to delete android\.gradle?
Yes, deleting the project-local android\.gradle directory is normally safe because Gradle recreates it during the next build. Stop Gradle first, delete only the .gradle folder inside the affected project’s android directory, and then run the Android build again. Do not begin by deleting the global Gradle cache or the entire Android project.
Should I change or remove com.facebook.react.settings?
No, not when the error includes a temporary-workspace move failure. The plugin ID is part of the React Native Android setup, and removing it can break autolinking or other settings configuration. Change it only when you have confirmed that your settings.gradle differs from the template for the exact React Native version installed in the project.
Why can a newly created project fail while an older project works?
A newly created project can use a different React Native template, Gradle setup, dependency graph, or local cache state than an older project. A working React Native 0.74.3 project and a failing 0.75.2 project are useful comparison points, but the meaningful test is whether their native templates and installed dependencies match their own versions. Compare the settings files and lockfiles before concluding that a version downgrade is necessary.
What should I include when asking for help?
Include the complete error from What went wrong through the deepest Caused by line. Also include the React Native version, Node and package-manager versions, Gradle version, operating system, whether the project is in a synced folder, and the exact project-creation command. The path after Could not move temporary workspace is especially useful because it identifies the Gradle cache Gradle could not finalize.
