我工作的一個離子2測試版(最新版本)的項目方法。 該應用程序運行在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
我在模擬自己(在iPhone上)有一些問題,但我解決了它通過使用運行''關鍵字來代替:''離子運行android'' – John
@約翰我嘗試使用'離子運行android',但它不起作用 – tymspy
您是否將android添加到您的平臺? ''離子平臺添加android'' – John