我正在研究Ionic 2 beta(最新版本)项目。
该应用程序在Web客户端上运行,没有任何错误。
但是,当我试图模仿时,我得到一个白色的屏幕(死亡的白色屏幕)。
adb logcat
中没有记录错误。
因此尝试使用实时重新加载来模拟应用程序。 (如上所述here)。
当我执行命令ionic emulate android -l -c
我收到此错误:
Error happened TypeError: Can't call method on undefined
at TypeError (native)
at module.exports (D:\ionicApp\node_modules\core-js\modules\_defined.js:3:28)
at createHTML (D:\ionicApp\node_modules\core-js\modules\_string-html.js:7:19)
at bold (D:\ionicApp\node_modules\core-js\modules\es6.string.bold.js:5:12)
at cb (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:206:7)
at done (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:167:19)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:40:16
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:193:9
at [object Object].Console.log (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\transports\console.js:127:3)
at emit (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:186:17)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:157:13
at _each (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:57:9)
at Object.async.each (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\node_modules\async\lib\async.js:156:9)
at [object Object].Logger.log (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\logger.js:214:9)
at [object Object].target.(anonymous function) [as info] (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\winston\lib\winston\common.js:54:18)
at Object.IonicTask.setupLiveReload (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\lib\ionic\cordova.js:338:7)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\lib\ionic\cordova.js:104:21
at _fulfilled (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:749:13)
at C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:509:49
at flush (C:\Users\User1\AppData\Roaming\npm\node_modules\ionic\node_modules\q\q.js:108:17)
at nextTickCallbackWith0Args (node.js:456:9)
at process._tickCallback (node.js:385:13)
有人遇到过这个,你的解决方案是什么? 参考:https://forum.ionicframework.com/t/emulate-run-with-livereload-not-working/48330
答案 0 :(得分:0)
更新到latsets ionic 2版本。 npm install ionic@beta
答案 1 :(得分:0)
为了解决这个问题,我已经完成了以下工作。
今天起作用....