React-Native 빌드 오류들 해결하기

김기수·2026년 3월 14일
post-thumbnail

package.json 의 버전을 정확하게 써준다

and

yarn.lock의 파일을 잃어버리지 않게 유의!

1 캐시 초기화

Windows 기준으로 프로젝트와 Gradle/CMake 캐시 초기화:

# 루트에서
rm -rf node_modules yarn.lock
yarn cache clean
yarn install

# Android 빌드 캐시 초기화
cd android
rd /s /q "build"
rd /s /q ".cxx"
rd /s /q ".gradle"
./gradlew clean
cd ..



2 Dev-client 빌드

gradlew assembleDebug
# 또는
npx expo run:android

3 Metro Bundler 캐시 초기화

npx expo start -c
  • 워크렛, Reanimated, Gesture-handler 관련 Metro 캐시 문제 방지

✅ 순서 요약

  1. package.json에서 워크렛/네이티브 모듈 버전 고정
  2. node_modules, Gradle, CMake 캐시 완전히 초기화
  3. gradlew assembleDebug 또는 npx expo run:android
  4. Metro Bundler 캐시 클리어 npx expo start -c

번외)

Codegen 강제 생성

Android 프로젝트 안에서:

cd android
gradlew :app:generateDebugSources
  • 아래 폴더들이 생성되는지 확인:
android/app/build/generated/source/codegen/jni/
node_modules/react-native-reanimated/android/build/generated/source/codegen/jni/
  • 폴더가 없으면 CMake/Ninja 빌드 실패
profile
엄청난 클라우드 고수

0개의 댓글