How to rebuild the entire Android folder?

后端 未结 8 2321
长发绾君心
长发绾君心 2021-01-31 17:44

I have messed the files up in the Android folder and would like to rebuild the Android project inside of the Android folder. How do I do this?

Is it safe to delete the

8条回答
  •  佛祖请我去吃肉
    2021-01-31 18:11

    Yes, it is safe to delete the Android and IOS folder and you can make it again by following steps:

    1.First Method: react-native eject <=0.59.0

    React-native had this command in the previous version. Running this command will check if the ios and android directories exist and then rebuild whichever one is missing.

    sudo rm -rf android/ ios/

    react-native eject // Will create new Android and IOS folder.

    react-native link

    react-native run-android

    2.Second Method: react-native upgrade --legacy true>=0.60.0

    Now you should use the react-native upgrade --legacy true command to back up your android folders or ios as the case may be as this command will replace your files.

提交回复
热议问题