Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error resolving plugin [id: 'com.facebook.react.settings'] #46133

Closed
adhikarisandil32 opened this issue Aug 21, 2024 · 12 comments
Closed

Error resolving plugin [id: 'com.facebook.react.settings'] #46133

adhikarisandil32 opened this issue Aug 21, 2024 · 12 comments

Comments

@adhikarisandil32
Copy link

Description

FAILURE: Build failed with an exception.

* Where:
Settings file 'F:\tutorial-practice\frontend-development\react-native\native-cli-todo-app-2\android\settings.gradle' line: 2

* What went wrong:
Error resolving plugin [id: 'com.facebook.react.settings']
> java.io.UncheckedIOException: Could not move temporary workspace (F:\tutorial-practice\frontend-development\react-native\native-cli-todo-app-2\android\.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10-29ae1a11-17a6-474d-825c-7114fe1603d2) to immutable location (F:\tutorial-practice\frontend-development\react-native\native-cli-todo-app-2\android\.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10)

This is the full error. The command I've used to create the project is npx @react-native-community/cli init TodoApp2 --directory ./native-cli-todo-app-2. The projects is created successfully. After I run npm run start and hit a, for android, build fails showing the above error. Another project which uses 0.74.3 is working just fine. Creating new project automatically uses 0.75.2 version which is fine, but it shows the error while building because of which development server doesn't start.

359618830-15d3e0bb-760f-4d17-b888-31642e633297

Steps to reproduce

  1. Create the project files with npx @react-native-community/cli init ProjectName --directory ../ProjectDirectory
  2. After project files are created successfully, hit npm run start and Metro asks where to run, since i want to run it on android, I hit a
  3. Then the error shows up.

React Native Version

0.75.2

Affected Platforms

Runtime - Android, Build - Windows

Output of npx react-native info

System:
  OS: Windows 11 10.0.22631
  CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
  Memory: 1.69 GB / 7.90 GB
Binaries:
  Node:
    version: 20.10.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn: Not Found
  npm:
    version: 10.2.3
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowAllTrustedApps: Disabled
IDEs:
  Android Studio: AI-241.18034.62.2411.12071903
  Visual Studio: Not Found
Languages:
  Java: 17.0.11
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.75.2
    wanted: 0.75.2
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found


### Stacktrace or Logs

```text
Error resolving plugin [id: 'com.facebook.react.settings']
> java.io.UncheckedIOException: Could not move temporary workspace (F:\tutorial-practice\frontend-development\react-native\native-cli-todo-app-2\android\.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10-df5899d5-a017-403d-b535-3a943b94f28a) to immutable location (F:\tutorial-practice\frontend-development\react-native\native-cli-todo-app-2\android\.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10)


### Reproducer

https://github.com/adhikarisandil32/native-cli-todo-app

### Screenshots and Videos



![Screenshot 2024-08-21 175545](https://github.com/user-attachments/assets/f31e772a-4f66-4c4f-bf1a-ed16b46a9a24)
@cortinico
Copy link
Contributor

Could you remove this folder:

F:\tutorial-practice\frontend-development\react-native\native-cli-todo-app-2\android\.gradle

and try again?

@cl3i550n
Copy link

Same error here

FAILURE: Build failed with an exception.

* Where:
Settings file 'path\android\settings.gradle' line: 2

* What went wrong:
Error resolving plugin [id: 'com.facebook.react.settings']
> java.io.UncheckedIOException: Could not move temporary workspace (path\android\.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10-d437262d-9486-4a7e-a868-29b809f9924f) to immutable location (path\android\.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10)

@adhikarisandil32
Copy link
Author

adhikarisandil32 commented Aug 21, 2024

Could you remove this folder:

F:\tutorial-practice\frontend-development\react-native\native-cli-todo-app-2\android\.gradle

and try again?

No Luck, sir @cortinico . The issue still persists.
However I believe I've found, let's say, a hack. If I go npm run android on the VSCode terminal, along with the terminal it also opens command prompt automatically. The VSCode terminal shows error, but the command prompt terminal successfully runs development. Then I close the command prompt terminal. Stop the development server on the VSCode Terminal, clear the terminal and hit npm run start and then a. Now the app is successfully installed on my device without any error.

I create another app, and I've to do the same. And that's one tedious process.

@Ricardo-Veiga-Lemes
Copy link

Ricardo-Veiga-Lemes commented Aug 21, 2024

I have the same problem.
The "hack" didn't work for me.

@adhikarisandil32
Copy link
Author

I have the same problem. The "hack" didn't work for me.

.I'm using it on my actual real device. May be you could also try that on actual device. @Ricardo-Veiga-Lemes

@ramilqO
Copy link

ramilqO commented Aug 22, 2024

I solve this problem with npm run android

@Ricardo-Veiga-Lemes
Copy link

image
In all cases I have to press "a"
to run android.
When I run "npm run android" it opens the Windows terminal, but there I also have to press "a" to continue and then the same error returns.
image

@adhikarisandil32
Copy link
Author

adhikarisandil32 commented Aug 22, 2024

@Ricardo-Veiga-Lemes I'm using my real device. Are you using it too ? Also, why don't you delete the project and start a new completely new form the command npx @react-native-community/cli init ProjectName --directory ../DirectoryName not on the VSCode terminal but on windows terminal. And then open up the directory containinig project files, hit npm run android first, do as it says. Exit the windows terminal, stop the vscode terminal server, clear the console and hit npm run start and do as it says.

As I can see, your react-native project uses 0.75.1, but mine uses 0.75.2, the latest one I guess. And if nothing works, try creating an app with expo.

@tecnologiacd2
Copy link

Roll back versions: 0.75.2 to 0.75.1

@react-native/gradle-plugin
react-native
@react-native/babel-preset
@react-native/eslint-config
@react-native/metro-config
@react-native/typescript-config

*Don't run npm/yarn fix, it updates without permission and becomes incompatible

@ericmtzmtz
Copy link

Roll back versions: 0.75.2 to 0.75.1

@react-native/gradle-plugin react-native @react-native/babel-preset @react-native/eslint-config @react-native/metro-config @react-native/typescript-config

*Don't run npm/yarn fix, it updates without permission and becomes incompatible

don't work for me I go down until 0.73.6

@MDavidMR
Copy link

Roll back versions: 0.75.2 to 0.75.1

@react-native/gradle-plugin react-native @react-native/babel-preset @react-native/eslint-config @react-native/metro-config @react-native/typescript-config

*Don't run npm/yarn fix, it updates without permission and becomes incompatible

Thanks, it worked for me. I just changed the entries in the package.json file.

@cortinico
Copy link
Contributor

Closign as this duplicates #46210

Let's keep the conversation only in one issue as it's impossible for us to help you otherwise

@facebook facebook locked as resolved and limited conversation to collaborators Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants