React native is stuck at old version app

前端 未结 8 1378
慢半拍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:30

    I had this happen while working with iOS, and here are the steps I took to get back to working order:

    $ react-native start --reset-cache
    $ rm -rf ios/build
    

    Doing this much on its own will force RN to rebuild the iOS version from scratch when you run yarn ios, so this could be answer for most anyone else running with iOS.

    In my latest encounter of this issue, I found that after forcing a new build, metro-bundler would throw the following error: Metro Bundler has encountered an error: SHA-1 for file < some file in node_modules >

    With this, I had to refresh my node_modules in order to resolve the issue completely.

    $ rm -r node_modules
    $ yarn
    

提交回复
热议问题