[RN Error] java.lang.RuntimeException: Unable to load script. Make sure you're either running Metro (run 'react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.

1691 단어 RN ErrorRN Error

ERROR:

java.lang.RuntimeException: Unable to load script. Make sure you're either running Metro (run 'react-native start') or that your bundle 'index.android.bundle' is packaged correctly for release.

SOLVE:

  1. [패키지명]/android/app/src/main/assets 폴더가 있는지 확인하고 없으면 생성

2. [패키지명]/android 폴더에서 ./gradlew clean 실행

  1. [패키지명] 폴더에서 아래 명령어 실행
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle

4. react-native run-android

Ref:
https://dlevelb.tistory.com/1142

https://mant81.tistory.com/226

좋은 웹페이지 즐겨찾기