If don't run cd android && ./gradlew clean
before react-native run-android
this fails with some error like:
Failed to create folder: ...
or
Failed to delete folder: ...
so I must run more times again to solve it.
Help me solve it without gradlew clean
, please.
Thanks so much.
To clean cache in react native, open terminal, go to your project android folder, and run gradlew clean command it will clear react native cache.
it removes build folder, as well configure your modules and then build your project. i use it before release any new app on playstore.
The difference lies in the fact that ./gradlew indicates you are using a gradle wrapper. The wrapper is generally part of a project and it facilitates installation of gradle.
For clean android project run following command
cd android &&./gradlew clean
to re-run
cd .. && react-native run-android
I'm having a similar problem since upgrading to RN 43. I haven't found the solution yet but realised that a clean in necessary before a successful build will occur.
Best solution for me so far is a batch script to start the project which includes gradlew clean
@echo on cd (path to project/android folder) && ^ gradlew clean && ^ cd (path to project root folder) && ^ react-native run-android
commands: 1.cd (path to project/android folder) 2.gradlew clean 3. cd .. 4.react-native run-android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With