Has*_*aig 24
似乎我们每次将它们编译到android应用程序时都必须重新捆绑资产.这对我有用:
首先运行这个:react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest andro ID /应用/ src目录/主/ RES
然后这个:react-native run-android
你试过了react-native start --reset-cache吗?
或者,也许您可以尝试重置MAX_WAIT_TIME(我在这里找到它)。在文件中,\node_modules\node-haste\lib\FileWatcher\index.js
您应该增加MAX_WAIT_TIME变量(例如:360000)并更改功能_createWatcher.
从:
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);
});
});
}
Run Code Online (Sandbox Code Playgroud)
至:
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);
});
});
}
Run Code Online (Sandbox Code Playgroud)
愿它对您有帮助!:D
| 归档时间: |
|
| 查看次数: |
6312 次 |
| 最近记录: |