UnhandledPromiseRejectionWarning:错误:从选择器“widget”修剪:Ionic

问题描述 投票:1回答:1

当我尝试运行命令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.

我怎么解决这个问题?

node.js cordova ionic-framework ionic2 ionic3
1个回答
0
投票

跟着这些步骤。

  1. 删除所有平台。

rm -rf platforms

  1. 删除所有插件。

rm -rf plugins

  1. 更新Cordova

sudo npm update -g cordova

  1. 再次添加平台。

ionic cordova platform add android

ionic cordova platform add ios

  1. 运行应用程序

ionic cordova run android

© www.soinside.com 2019 - 2024. All rights reserved.