How can I regenerate ios folder in React Native project?
react-native-cli: 2.0.1
react-native: 0.61.2
โฏ react-native eject
error Unrecognized command "eject".
info Run "react-native --help" to see a list of all available commands.
โฏ react-native upgrade --legacy true
error: unknown option `--legacy'
You can init a new project that's named the same in another folder and copy ios dir over:
# inside YourProjectName directory
npx react-native init YourProjectName
mv YourProjectName/ios ios
rm -rf YourProjectName
Make sure you have clean git history before doing so, in case you need to revert
thanks
You can init a new project that's named the same in another folder and copy ios dir over:
# inside YourProjectName directory npx react-native init YourProjectName mv YourProjectName/ios ios rm -rf YourProjectNameMake sure you have clean git history before doing so, in case you need to revert
Omg, Why do that?, Can't we use "react-native upgrade --legacy true or react-native eject"?
think there should be an command like eject
@socialty If you feel like it, please create a detailed feature request with a motivation for why it's worth to spend time implementing such a feature, when you can do so manually without too much hassle (no great DX, but possible).
You can init a new project that's named the same in another folder and copy ios dir over:
# inside YourProjectName directory npx react-native init YourProjectName mv YourProjectName/ios ios rm -rf YourProjectNameMake sure you have clean git history before doing so, in case you need to revert
Omg, Why do that?, Can't we use "react-native upgrade --legacy true or react-native eject"?
It appears the latest version of react native got rid of those commands :(
think there should be an command like eject
As above react-native version, it seems like have been removed
You can init a new project that's named the same in another folder and copy ios dir over:
# inside YourProjectName directory npx react-native init YourProjectName mv YourProjectName/ios ios rm -rf YourProjectNameMake sure you have clean git history before doing so, in case you need to revert
thanks... I was getting crazy. Is this the only way? really??!!
You can init a new project that's named the same in another folder and copy ios dir over:
# inside YourProjectName directory npx react-native init YourProjectName mv YourProjectName/ios ios rm -rf YourProjectNameMake sure you have clean git history before doing so, in case you need to revert
Although not ideal, seems to be the best option for now. Thanks!
Add command to regenerate iOS or Android file incase of a mess up
Command already existed in previous versions of RN, but has been removed.
I solve this on ubuntu 20.04 running:
sudo npx react-native run-android
You can init a new project that's named the same in another folder and copy ios dir over:
# inside YourProjectName directory npx react-native init YourProjectName mv YourProjectName/ios ios rm -rf YourProjectNameMake sure you have clean git history before doing so, in case you need to revert
This one is great option!!
Most helpful comment
You can init a new project that's named the same in another folder and copy ios dir over:
Make sure you have clean git history before doing so, in case you need to revert