React Native/React Native_error

[React Native - andriud] java.io.UncheckedIOException: Could not move temporary workspace

bocoder
728x90
반응형

 

오랜만에 앱을 새로 하나 만들어 보려고 들어왔는데, react native v0.76 빌드 시에 아래와 같은 오류가 발생했다.

FAILURE: Build failed with an exception.

* Where:
Settings file 'E:\...\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:\...\android\.gradle\8.10.2\dependencies-accessors\569c8b261a8a714d7731d5f56...) to immutable location (E:\...\android\.gradle\8.10.2\dependencies-accessors\569c8b261a8a...)

 

 

결론은 JDK 와 gradle 버전이 맞지 않아서 발생한 이슈로, gradle 버전을 다운그레이드 했다.

파일명 : gradle-wrapper.properties

# before
...
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip

# after
...
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip

* reference : https://stackoverflow.com/questions/78384724/react-native-error-java-io-uncheckedioexception-could-not-move-temporary-work

 

 

하지만, 또  gradle 버전이 너무 낮아서 안된다는 에러를 만났다.

* Where:
Build file 'E:\...\android\app\build.gradle' line: 1

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.version-check'.
   > Minimum supported Gradle version is 8.7. Current version is 8.5. If using the gradle wrapper, try editing the distributionUrl in E:\...\android\gradle\wrapper\gradle-wrapper.properties to gradle-8.7-all.zip

 

 

RN 공식 홈페이지에서 가이드하는대로 gradle 8.10.2 버전을 그대로 사용하고, JDK 버전을 17 버전으로 업그레이드 했다.

빌드 성공.

 

 

 

* reference : https://reactnative.dev/docs/set-up-your-environment

 

Set Up Your Environment · React Native

In this guide, you'll learn how to set up your environment, so that you can run your project with Android Studio and Xcode. This will allow you to develop with Android emulators and iOS simulators, build your app locally, and more.

reactnative.dev

 

 

 

 

728x90
반응형