For General
Clear watchman watches: watchman watch-del-all
.
Delete the node_modules
folder: rm -rf node_modules && npm install
.
Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-*
or npm start -- --reset-cache
.
Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*
.
When the VS Code Icon appears small in Dock: killall Dock
For iOS
If there are some issues with new library etc (especially after RN 0.60)
- Close Xcode and pack manger.
- Clear Xcode Cache
rm -rf ~/Library/Developer/Xcode/DerivedData
- Go into ios folder
cd ios
- Clear CocoaPods Cache
pod deintegrate && pod cache clean --all
rm -rf Podfile.lock
- Re-Install Pods
pod install
- The install can take now a veeery long time — if it seems to be stuck, you should re-setup cocoa with an update before installing again, as follows:
gem install cocoapods
(you maybe have to use sudo)
then
pod repo remove master --verbose && pod setup --verbose && pod install --verbose
- then
pod install
On M1 machine
for homebrew users
step 1 brew install cocoapods
step 2 sudo arch -x86_64 gem install ffi
step 3 arch -x86_64 pod install
If you are setting up a new machine, you would need to do this first:
Command Line Tools
You will also need to install the Xcode Command Line Tools. Open Xcode, then choose "Preferences..." from the Xcode menu. Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.
For Android
If a library messed up and you need to clean up,
cd android/
./gradlew clean cleanBuildCache
When trying to get a release apk and got an error,
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
When Google Sign In or Firebase error,
npx jetify
Source
When Google Sign In gives an error (resources not found) in building release APK,
./gradlew app:assembleRelease
instead of ./gradlew assembleRelease
Source
Expo Updates
expo publish --release-channel <your-channel>