Deep cleaning react native project

In a react native project, a build issue can happen very frequently and sometimes it requires to wipe out all generated files by the framework, including, caches, build files, package lock files, libraries, etc. The following are a list of most of the cleaning you can do if not all of them.

Clean up android

rm -rf $HOME/.gradle/caches/
cd android
./gradlew cleanBuildCache
./gradlew clean
rm -rf build

Clean up ios

cd ios
rm Podfile.lock
rm -rf build/
rm -rf ~/Library/Developer/Xcode/DerivedData/yourproject-*

Clean up react native libraries.

cd ..
rm package-lock.json
npm cache clean --force
rm -rf node_modules

Reinstall the libraries

npm install
cd ios
pod install
cd ..

Run the apps

npm run android
npm run ios

Search within Codexpedia

Custom Search

Search the entire web

Custom Search