In react-native development, there are multiple caches used when the app is built:
try this
react-native start --reset-cache
I had a similar problem, I tried to clear all the caches possible (tried almost all the solutions above) and the only thing that worked for me was to kill the expo app and to restart it.
For those who are using expo-cli
expo start -c
If you are using WebStorm
, press configuration selection drop down button left of the run button and select edit configurations:
Double click on Start React Native Bundler
at bottom in Before launch
section:
Enter --reset-cache
to Arguments
section:
This is what works for me:
watchman watch-del-all && rm -f yarn.lock && rm -rf node_modules && yarn && yarn start --reset-cache
Here's a great discussion on GitHub which helped me a lot. Clearing the Cache of your React Native Project by Jarret Moses
There are solutions for 4 different instances.
RN <0.50 -
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
RN >=0.50 -
watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache
watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
del %appdata%\Temp\react-native-* & cd android & gradlew clean & cd .. & del node_modules/ & npm cache clean --force & npm install & npm start -- --reset-cache
The solution is similar to Vikram Biwal's Answer.
And there is a discussion below in the given link, so even if the above 4 cases don't work for you, you can scroll through and find a possible solution.