I am using React native 0.52.0 and react-native-cli 2.0.1 on my Windows PC for android development. Despite all the changes i have made. When I run react-native run-an
Try this
cd .git (in your react-native folder)
rm index.lock
and restart metro bundler i.e. react-native start
wallaa!!...
In my case when I disable debugging then it updates. So this is my solution.
in Chrome dev tools > Network > Disable cache Hope that shell work for you
Open package.json file and update this code.
"scripts": {
"android": "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 && react-native run-android",
"ios": "react-native run-ios"
},
Assuming that you are in the right folder, try to do this:
Run this command only it will automatically both commands.
npm run android
I was having this same problem but it didn't update my code just on a production build, it works fine in development.
My problem was CodePush, it was updating my app because it had the same version than the last CodePush release target version and it was a mandatory update (I didn't change the version target because it was just for testing purpose), then, I commented the CodePush code on my App.js and it works perfectly.
Open your Android Studio -> "Tools" menu -> "AVD manager" and right click the emulator you are using, choose "Wipe Data" then "Cold Boot Now" should solve the problem.
Run the script:
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
After that, just do:
$ gradlew clean
$ react-native link