React native stuck on old version of app
When I run react-aware run-android it only installs the old version of the app in the simulator and the changes are not shown.
Any suggestion is appreciated.
It looks like we have to rearrange the resources every time we compile them into an Android app. This worked for me:
-
First run this:
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
-
Then this:
react-native run-android
Have you tried react-native start --reset-cache
?
Or maybe you can try reset MAX_WAIT_TIME
(I found it here ). in the file \node_modules\node-haste\lib\FileWatcher\index.js
you have to increase the variable MAX_WAIT_TIME
(example: 360000) and change the function_createWatcher.
From:
key: '_createWatcher',
value: function _createWatcher(rootConfig) {
var watcher = new WatcherClass(rootConfig.dir, {
glob: rootConfig.globs,
dot: false
});
return new Promise(function (resolve, reject) {
var rejectTimeout = setTimeout(function () {
return reject(new Error(timeoutMessage(WatcherClass)));
}, MAX_WAIT_TIME);
watcher.once('ready', function () {
clearTimeout(rejectTimeout);
resolve(watcher);
});
});
}
To:
key: '_createWatcher',
value: function _createWatcher(rootConfig) {
var watcher = new WatcherClass(rootConfig.dir, {
glob: rootConfig.globs,
dot: false
});
return new Promise(function (resolve, reject) {
const rejectTimeout = setTimeout(function() {
reject(new Error([
'Watcher took too long to load',
'Try running `watchman version` from your terminal',
'https://facebook.github.io/watchman/docs/troubleshooting.html',
].join('\n')));
}, MAX_WAIT_TIME);
watcher.once('ready', function () {
clearTimeout(rejectTimeout);
resolve(watcher);
});
});
}
May this help!: D
Answer @Hashir Baig worked like a charm! You saved me hours of searching. Thank!
Tried with the solutions above, not sure if they helped for the final version, but what worked at the end is ./gradlew clean assembleRelease
in the folder /android
.