当我尝试运行命令ionic cordova run android
时,我得到的错误是> cordova run android
(node:5304) UnhandledPromiseRejectionWarning: Error: Pruning at selector "widget" from "D:\project-1\project-1\frontend\platforms\android\res\xml\config.xml" went bad.
at ConfigFile_prune_child [as prune_child] (D:\project-1\project-1\frontend\platforms\android\cordova\node_modules\cordova-common\src\ConfigChanges\ConfigFile.js:157:15)
at PlatformMunger_apply_file_munge [as apply_file_munge] (D:\project-1\project-1\frontend\platforms\android\cordova\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:80:41)
at PlatformMunger.remove_plugin_changes (D:\project-1\project-1\frontend\platforms\android\cordova\node_modules\cordova-common\src\ConfigChanges\ConfigChanges.js:106:14)
at D:\project-1\project-1\frontend\platforms\android\cordova\node_modules\cordova-common\src\PluginManager.js:126:29
at _fulfilled (D:\project-1\project-1\frontend\platforms\android\cordova\node_modules\q\q.js:854:54)
at self.promiseDispatch.done (D:\project-1\project-1\frontend\platforms\android\cordova\node_modules\q\q.js:883:30)
at Promise.promise.promiseDispatch (D:\project-1\project-1\frontend\platforms\android\cordova\node_modules\q\q.js:816:13)
at D:\project-1\project-1\frontend\platforms\android\cordova\node_modules\q\q.js:877:14
at runSingle (D:\project-1\project-1\frontend\platforms\android\cordova\node_modules\q\q.js:137:13)
at flush (D:\project-1\project-1\frontend\platforms\android\cordova\node_modules\q\q.js:125:13)
(node:5304) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:5304) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
我怎么解决这个问题?
跟着这些步骤。
rm -rf platforms
rm -rf plugins
Cordova
。sudo npm update -g cordova
ionic cordova platform add android
ionic cordova platform add ios
ionic cordova run android