[0.75.x] Failing to build on Windows - Error resolving plugin [id: 'com.facebook.react.settings'] - java.io.UncheckedIOException: Could not move temporary workspace
IMPORTANT: The latest official update on this issue is here https://github.com/facebook/react-native/issues/46210#issuecomment-2346835978
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.
facing same issue
facing same issue
@rghanks
I've found a trick though. hit npm run android, let it do its job all the way. Now exit the terminal, clear the console and then again hit npm run start. Work for me.
facing same issue
@rghanks
I've found a trick though. hit
npm run android, let it do its job all the way. Now exit the terminal, clear the console and then again hitnpm run start. Work for me.
this is working for me also
+1 οΌI tried switching different gradle versions but it didn't work.
facing same issue
@rghanks
I've found a trick though. hit
npm run android, let it do its job all the way. Now exit the terminal, clear the console and then again hitnpm run start. Work for me.
That's work for me! Thanks alot!!!!πππ
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
facing same issue
@rghanks
I've found a trick though. hit
npm run android, let it do its job all the way. Now exit the terminal, clear the console and then again hitnpm run start. Work for me.
Don't work for me π
@adhikarisandil32, thanks bro , i am facing same issue and it's work for me.
None of the proposed solutions seem to be working.
- Changed Java version from 17 to 21
- Downgraded from gradle 8.8 to 8.6/8.5
- Downgraded from RN 0.75.2 to 0.75.1
- Cleared cache, deleted
.gradleandbuilddirectories.
It always gets stuck at the same spot with the same error.
@Agent009 may be downgrade a version not on the same app but create a completely new project using npx @react-native-community/cli init ProjectName --version=0.74. just give it a try
Downgrading to RN 0.74.5 and Gradle 8.5 solves the issue.
Wonder how the new release has been working for other folks. May just be an issue with those with simulated devices running on emulators?
Downgrading to RN
0.74.5and Gradle8.5solves the issue. Wonder how the new release has been working for other folks. May just be an issue with those with simulated devices running on emulators?
@Agent009 I use it on real actual device and I face the same issue. I don't know. Nobody seems to be working on it. And I don't know react native enough to work on it. I don't know how to direct contributers to this issue.
| :warning: | Missing Reproducible Example |
|---|---|
| :information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
| :warning: | Missing Reproducible Example |
|---|---|
| :information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
Transferred to facebook/react-native as this isnβt Metro related and I canβt help directly. It looks like it might be specific to the community CLI but clearly itβs affecting quite a few people. CC @cortinico
still can't find a fix
Facing same issue
Downgrading to RN
0.74.5and Gradle8.5solves the issue. Wonder how the new release has been working for other folks. May just be an issue with those with simulated devices running on emulators?@Agent009 I use it on real actual device and I face the same issue. I don't know. Nobody seems to be working on it. And I don't know react native enough to work on it. I don't know how to direct contributers to this issue.
I have the same versions but still getting the error.
This works for me https://github.com/facebook/react-native/issues/46046#issuecomment-2295388352
i was facing the same issue what i just did to solve is
cd android
then
gradlew clean or ./gradlew clean
then
gradlew build or ./gradlew build
whatever works for you give it a try
then run your project
Due to a various of random comments, it's extremely hard for us to understand what happened here.
Please refrain from commenting "same issue" as that creates only unnecessary noise
As far as I understood:
- The issue is happening only on Windows
- The issue is happening only on React Native 0.75.x
If that is NOT the case for you -> Open another issue and do not comment here.
I've sharing some steps that could (hopefully help till we try to identify what's the issue):
- Make sure you don't have a version of
@react-native/gradle-pluginspecified in your package.json. If you have it, please remove it. - Check with
yarn why @react-native/gradle-pluginthat the output is:
$ yarn why @react-native/gradle-plugin
ββ react-native@npm:0.75.1
β ββ @react-native/gradle-plugin@npm:0.75.1 (via npm:0.75.1)
β
ββ react-native@npm:0.75.1 [473c9]
ββ @react-native/gradle-plugin@npm:0.75.1 (via npm:0.75.1)
- Kill all the Gradle daemons with
cd android && ./gradlew --stop - Remove the
.gradlefolder withcd android && rm -rf .gradle/ && rm -rf ~/.gradle/caches - Attemp to downgrade to Gradle 8.6 by changing this file
android/gradle/wrapper/gradle-wrapper.properties:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
- Attempt to upgrade to Gradle 8.10 by editing the same file.
Please report back if this solves the issue @Agent009
(Related to https://github.com/gradle/gradle/issues/27844)
Due to a various of random comments, it's extremely hard for us to understand what happened here.
Please refrain from commenting "same issue" as that creates only unnecessary noise
As far as I understood:
- The issue is happening only on Windows
- The issue is happening only on React Native 0.75.x
If that is NOT the case for you -> Open another issue and do not comment here.
I've sharing some steps that could (hopefully help till we try to identify what's the issue):
- Make sure you don't have a version of
@react-native/gradle-pluginspecified in your package.json. If you have it, please remove it.- Check with
yarn why @react-native/gradle-pluginthat the output is:$ yarn why @react-native/gradle-plugin ββ react-native@npm:0.75.1 β ββ @react-native/gradle-plugin@npm:0.75.1 (via npm:0.75.1) β ββ react-native@npm:0.75.1 [473c9] ββ @react-native/gradle-plugin@npm:0.75.1 (via npm:0.75.1)
- Kill all the Gradle daemons with
cd android && ./gradlew --stop- Remove the
.gradlefolder withcd android && rm -rf .gradle/ && rm -rf ~/.gradle/caches- Attemp to downgrade to Gradle 8.7 by changing this file
android/gradle/wrapper/gradle-wrapper.properties:distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists
- Attempt to upgrade to Gradle 8.10 by editing the same file.
Please report back if this solves the issue @Agent009
- yarn why @react-native/gradle-plugin
Hi cortinico, I tried your suggestions step by step but the problem persists...
I'm so confused because yesterday I created a new proyect with 0.75.2 but it didn't run with 'npm run andoid' ( 'com.facebook.react.settings' error) so I changed it version to 0.75.1, after this, the project worked.
Today I tried to create other project following the previous 'hack' but 'com.facebook.react.settings' error is showing again.
Hi @MDavidMR can you try to run gradlew clean and see if it resets the state of the machine?
If you keep 0.75.2 and downgrade gradle to 8.7 as shown by @cortinico above, is the problem fixed?
Not working with RN 0.75.1 as well.
Hi @MDavidMR can you try to run
gradlew cleanand see if it resets the state of the machine? If you keep 0.75.2 and downgrade gradle to 8.7 as shown by @cortinico above, is the problem fixed?
yes it work for me i just downgraded gradle, deleted app/buld folder and then try to clean gradle. its done
so it is due to https://github.com/facebook/react-native/issues/46210#issuecomment-2315211671 as Nicola pointed out. We can try to downgrade gradle and wait for 8.9 to come out with a fix. @blakef
cd android ./gradlew clean ./gradlew --stop Then, go back to the root directory of your project and run: npx react-native run-android
I did this and it is working for me. You don't have to downgrade gradle with this method.
cd android ./gradlew clean ./gradlew --stop Then, go back to the root directory of your project and run: npx react-native run-android
I did this and it is working for me. You don't have to downgrade gradle with this method.
I followed this, and working fine for me. Thanks dear
Downgrading to RN
0.74.5and Gradle8.5solves the issue. Wonder how the new release has been working for other folks. May just be an issue with those with simulated devices running on emulators?
how did you downgrade react native?