React native run-android do not updating modified code

后端 未结 21 3111
故里飘歌
故里飘歌 2020-12-13 06:02

I am using React native 0.52.0 and react-native-cli 2.0.1 on my Windows PC for android development. Despite all the changes i have made. When I run react-native run-an

相关标签:
21条回答
  • 2020-12-13 06:51

    in your terminal window go to your project folder and than try this command

    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/
    
    0 讨论(0)
  • 2020-12-13 06:51

    This worked for me:

    In your project folder run this

    c:\Users\lenger\Desktop\YourProjectFolder>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
    

    Scanning folders for symlinks in c:

    \Users\lenger\Desktop\webrowser\node_modules (43ms)
    Scanning folders for symlinks in c:\Users\lenger\Desktop\webrowser\node_modules (38ms)
    Loading dependency graph, done.
    bundle: start
    bundle: finish
    bundle: Writing bundle output to: android/app/src/main/assets/index.android.bundle
    bundle: Done writing bundle output
    

    Run react-native run-android again

    I share the link where i found this solution: https://lengerrong.blogspot.com/2018/01/react-native-run-android-do-not.html

    0 讨论(0)
  • 2020-12-13 06:51

    there was no index.android.js or index.ios.js file

    In this case you have to follow the instructions on your mobile/emulator as below:

    After saved your App.js, remember to type twice R in uppercase

    For make it automatically changes, on Android emulator press CTRL + M (CMD + M on MacOS) or shake the Android device which has the running app and select Hot reloading (keep current state, change only the file you have changed) or Live reloading (reload the entire app).

    0 讨论(0)
提交回复
热议问题