프로젝트/Profee

[RN] Error resolving plugin [id: 'com.facebook.react.settings'] 오류 해결

승요나라 2024. 10. 14. 18:55

Settings file '/Users/[사용자이름]/Profee_Client/android/settings.gradle' line: 2

 

Error resolving plugin [id: 'com.facebook.react.settings'] > Included build '/Users/[사용자이름]/Profee_Client/node_modules/@react-native/gradle-plugin' does not exist.

 

* Try: > 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.

 

* Exception is: org.gradle.api.GradleException: Error resolving plugin [id: 'com.facebook.react.settings']

at .....

 

 

Android Studio - Project Errors 화면

 

잘 빌드되었던 프로젝트에서 갑자기 [id: 'com.facebook.react.settings'] 플러그인에 대한 의존성을 찾을 수 없다는 오류가 뜰 때가 있다. 이는 @react-native/gradle-plugin 디렉토리가 존재하지 않아서 발생하는 문제이다.

 

 

 

해결 방법

1. 의존성 설치 확인:

@react-native/gradle-plugin이 node_modules에 설치되어 있는지 확인한다. 프로젝트 루트 디렉토리에서 다음 명령어를 실행한다.

npm install

 

 

2. React Native 재설치:

만약 의존성이 제대로 설치되지 않았다면, React Native를 다시 설치해야 한다.

npm uninstall react-native
npm install react-native

 

 

3. 캐시 정리:

Gradle 캐시를 정리한 후, 프로젝트를 다시 빌드한다.

./gradlew clean

 

 

 

 

BUILD SUCCESSFUL 이 뜨며 빌드가 성공적으로 완료된 것을 확인할 수 있다.

해결 완료 👍