Build failed using [email protected]
Description
Hi, I tried using npx react-native init Client and npx @react-native-community/cli@latest init Client. Both times, the build failed. Android Emulator and Metro are connected, but not recognizing My package.json file: { "name": "Client", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest" }, "dependencies": { "react": "^18.1.0", "react-native": "0.75.2" }, "devDependencies": { "@babel/core": "^7.20.0", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", "@react-native/babel-preset": "0.75.2", "@react-native/eslint-config": "0.75.2", "@react-native/metro-config": "0.75.2", "@react-native/typescript-config": "0.75.2", "@types/react": "^18.2.6", "@types/react-test-renderer": "^18.0.0", "babel-jest": "^29.6.3", "eslint": "^8.19.0", "jest": "^29.6.3", "prettier": "2.8.8", "react-test-renderer": "18.3.1", "typescript": "5.0.4" }, "engines": { "node": ">=18" } }
Thanks, Lalitha
Steps to reproduce
npx @react-native-community/cli@latest init Client
React Native Version
0.75.2
Affected Platforms
Runtime - Android
Output of npx react-native info
npx react-native info
info Fetching system and libraries information...
System:
OS: Windows 11 10.0.22631
CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
Memory: 4.99 GB / 15.85 GB
Binaries:
Node:
version: 18.18.0
path: C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm:
version: 9.6.2
path: C:\Program Files\nodejs\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels:
- "28"
- "29"
- "30"
- "31"
- "32"
- "33"
- "33"
- "33"
- "34"
- "35"
Build Tools:
- 28.0.3
- 29.0.2
- 29.0.3
- 34.0.0
- 35.0.0
System Images:
- android-28 | Google APIs Intel x86_64 Atom
- android-29 | Google APIs Intel x86 Atom
- android-30 | Google APIs Intel x86 Atom
- android-31 | Google APIs Intel x86_64 Atom
- android-34 | ARM 64 v8a
- android-34 | Intel x86_64 Atom
- android-34 | Google APIs ARM 64 v8a
- android-34 | Google Play Intel x86_64 Atom
- android-35 | Google APIs Intel x86 Atom_64
- android-35 | Google Play ARM 64 v8a
Android NDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
IDEs:
Android Studio: Not Found
Visual Studio: Not Found
Languages:
Java: 17.0.8
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.1.0
wanted: ^18.1.0
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
npm run android --info
> [email protected] android
> react-native run-android
info A dev server is already running for this project on port 8081.
info Launching emulator...
error Failed to launch emulator. Reason: The emulator (Pixel_7_API_34) quit before it finished opening. You can try starting the emulator manually from the terminal with: C:\Users\Admin\AppData\Local\Android\Sdk/emulator/emulator @Pixel_7_API_34.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor
FAILURE: Build failed with an exception.
* Where:
Settings file 'E:\ReactNative\RNNodeAuth\Client\android\settings.gradle' line: 2
* What went wrong:
Error resolving plugin [id: 'com.facebook.react.settings']
> java.io.UncheckedIOException: Could not move temporary workspace (E:\ReactNative\RNNodeAuth\Client\android\.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10-6fe9999e-9d02-4604-b013-3a28c39832e2) to immutable location (E:\ReactNative\RNNodeAuth\Client\android\.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10)
* 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 3s
error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * Where: Settings file 'E:\ReactNative\RNNodeAuth\Client\android\settings.gradle' line: 2 * What went wrong: Error resolving plugin [id: 'com.facebook.react.settings'] > java.io.UncheckedIOException: Could not move temporary workspace (E:\ReactNative\RNNodeAuth\Client\android\.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10-6fe9999e-9d02-4604-b013-3a28c39832e2) to immutable location (E:\ReactNative\RNNodeAuth\Client\android\.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10) * 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 3s.
info Run CLI with --verbose flag for more details.
Reproducer
https://github.com/lalithasj/Client/tree/main
Screenshots and Videos
No response
same issue. I am using mac m1
Hi,
I'm facing an issue with my Android build after upgrading the React Native version to 0.75.2
Help will be highly appreciated!
Hi,
I'm facing an issue with my Android build after upgrading the React Native version to 0.75.2
Help will be highly appreciated!
I have the same problems and also hope the RN team can help us with them.
Hi, changing the npm react-native and npm @react-native-community/cli versions to previous versions is also not helpful.
Appreciate any suggestions
i am also facing same issue Appreciate any suggestions
Actually IDK but it is working when you run npm run android it will open another terminal on windows and the build fail on vs code, but if you click a on that new terminal It will create and install build, but error of metro run running. After that you just do npm run android again and it will install and run perfect.
Hi @piyush362 , Thank you for your response. But your suggestion isn't working for me. npm run android in VS code and then a in the metro window. Then again npm run android in VS Code window not working.
Hi @piyush362 , Thank you for your response. But your suggestion isn't working for me. npm run android in VS code and then a in the metro window. Then again npm run android in VS Code window not working.
For now, you can use v0.73.* or v0.74.* for more stable perfomance
Hi @piyush362 ,
Thank you for your suggestion. Unfortunately this is also not working
npx [email protected] init RNExpress3 --template react-native-template-typescript
- creating empty folder and no files in it
- error : npx [email protected] init RNExpress3 --template react-native-template-typescript
warn Ignoring custom template: 'react-native-template-typescript'. Starting from React Native v0.71 TypeScript is used by default.
npx @react-native-community/[email protected] init RNExpressEcomm2
- This is also creating empty folder
- ✖ Copying template error Couldn't find the "C:\Users\Admin\AppData\Local\Temp\rncli-init-template-6aoPvZ\node_modules\react-native\template.config.js file inside "react-native" template. Please make sure the template is valid. Read more: https://github.com/react-native-community/cli/blob/master/docs/init.md#creating-custom-template.
npx [email protected] init RNExpress1
- This is also creating empty folder and above template error
Appreciate any suggestions
Closing as duplicate of:
- https://github.com/facebook/react-native/issues/46210
@lalithasj please try again with 0.75.3 and report back if the issue persists.
Hi @cortinico,
Thank you for your suggestion. I tried with 0.75.3
FAILURE: Build failed with an exception. tion: Could not move temporary workspace (E:\ReactNative\TestSept12\android.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10-d2f93cd8-cdb8-49ec-a8cb-6b8dbb956526) to immutable location (E:\ReactNative\TestSept12\android.gradle\8.8\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10) * 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 15s.
Appreciate any suggestions
Let's keep the conversation in https://github.com/facebook/react-native/issues/46210
Help will be highly appreciated!