React native is stuck at old version app

前端 未结 8 1386
慢半拍i
慢半拍i 2020-12-28 21:50

When I run react-native run-android it only installs the old version of the app in simulator and changes are not shown.

Any suggestion is appreciated.

8条回答
  •  情歌与酒
    2020-12-28 22:22

    Seems like we have to re-bundle assets every time we compile it to android app. This worked for me:

    1. First run this:

      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
      
    2. Then this:

      react-native run-android
      

提交回复
热议问题