最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

react native - How to solve UncheckedIOException Error on ReactNative Setup? - Stack Overflow

programmeradmin1浏览0评论

I'm setting React Native up for an android project. i had installed all dependencies and checked by npx react-native doctor and this is the doctor's result:

Common
 ✓ Node.js - Required to execute JavaScript code
 ✓ npm - Required to install NPM dependencies
 ✓ Metro - Required for bundling the JavaScript code

Android
 ✓ Adb - Required to verify if the android device is attached correctly
 ✓ JDK - Required to compile Java code
 ✓ Android Studio - Required for building and installing your app on Android
 ✓ ANDROID_HOME - Environment variable that points to your Android SDK installation
 ✓ Gradlew - Build tool required for Android builds
 ✓ Android SDK - Required for building and installing your app on Android

Errors:   0
Warnings: 0

now in terminal I use npx react-native run-android command to run my sample project but i get this error:

BUILD FAILED in 23s
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 'D:\Projects\AwesomeProject\android\settings.gradle' line: 2 * What went wrong: Error resolving plugin [id: 'com.facebook.react.settings'] > java.io.UncheckedIOException: Could not move temporary workspace (D:\Projects\AwesomeProject\android\.gradle\8.10.2\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10-dd285373-4e2a-49c9-8a20-5145657540c5) to immutable location (D:\Projects\AwesomeProject\android\.gradle\8.10.2\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 . BUILD FAILED in 23s.

I saw in a youtube video that I should open the project in android studio once then this error would be solved but again I'm getting same error there:

I had tried to delete caches folder in .gradle directory also changed gradle folders access to full.

please anyone help me and community to solve this problem, I would buy him a coffee.

I'm setting React Native up for an android project. i had installed all dependencies and checked by npx react-native doctor and this is the doctor's result:

Common
 ✓ Node.js - Required to execute JavaScript code
 ✓ npm - Required to install NPM dependencies
 ✓ Metro - Required for bundling the JavaScript code

Android
 ✓ Adb - Required to verify if the android device is attached correctly
 ✓ JDK - Required to compile Java code
 ✓ Android Studio - Required for building and installing your app on Android
 ✓ ANDROID_HOME - Environment variable that points to your Android SDK installation
 ✓ Gradlew - Build tool required for Android builds
 ✓ Android SDK - Required for building and installing your app on Android

Errors:   0
Warnings: 0

now in terminal I use npx react-native run-android command to run my sample project but i get this error:

BUILD FAILED in 23s
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 'D:\Projects\AwesomeProject\android\settings.gradle' line: 2 * What went wrong: Error resolving plugin [id: 'com.facebook.react.settings'] > java.io.UncheckedIOException: Could not move temporary workspace (D:\Projects\AwesomeProject\android\.gradle\8.10.2\dependencies-accessors\569c8b261a8a714d7731d5f568e0e5c05babae10-dd285373-4e2a-49c9-8a20-5145657540c5) to immutable location (D:\Projects\AwesomeProject\android\.gradle\8.10.2\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.. BUILD FAILED in 23s.

I saw in a youtube video that I should open the project in android studio once then this error would be solved but again I'm getting same error there:

I had tried to delete caches folder in .gradle directory also changed gradle folders access to full.

please anyone help me and community to solve this problem, I would buy him a coffee.

Share Improve this question edited Nov 20, 2024 at 9:46 Mehdi asked Nov 20, 2024 at 9:36 MehdiMehdi 831 silver badge10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Solved after 12 days conflict to setup react native and no answer in community.

run these steps:

  1. run npx react-native doctor
  2. be sure you pass all doctor items
  3. open terminal and go to you project directory
  4. cd android
  5. run rd /s /q .gradle
  6. run npx react-native run-android
发布评论

评论列表(0)

  1. 暂无评论