(节点:15016)UnhandledPromiseRejectionWarning:错误:adb:命令失败,退出代码为1

时间:2018-09-19 11:39:47

标签: android cordova ionic-framework adb

我在尝试使用模拟器或设备中的离子Cordova运行示例应用程序“选项卡”时遇到问题。 我正在使用Ubuntu 18.04,并已安装java sdk,android studio,node.js和所有内容。我需要一些帮助,因为我可以找到有关此问题的信息。

我收到以下控制台消息:

Skipping build...
Built the following apk(s): 
    /home/irene/test/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Using apk: /home/irene/test/platforms/android/app/build/outputs/apk/debug/app-debug.apk
Package name: io.ionic.starter
(node:15016) UnhandledPromiseRejectionWarning: Error: adb: Command failed with exit code 1 Error output:
adb: failed to install /home/irene/test/platforms/android/app/build/outputs/apk/debug/app-debug.apk: Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package io.ionic.starter signatures do not match the previously installed version; ignoring!]
    at ChildProcess.whenDone (/home/irene/test/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Socket.stream.socket.on (internal/child_process.js:346:11)
    at emitOne (events.js:116:13)
    at Socket.emit (events.js:211:7)
    at Pipe._handle.close [as _onclose] (net.js:567:12)
(node:15016) 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:15016) [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.

我的离子信息是:

Ionic:

   ionic (Ionic CLI)  : 4.1.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.4, (and 4 other plugins)

System:

   Android SDK Tools : 26.1.1 (/home/irene/Android/Sdk/)
   NodeJS            : v8.10.0 (/usr/bin/node)
   npm               : 3.5.2
   OS                : Linux 4.15

2 个答案:

答案 0 :(得分:1)

[INSTALL_FAILED_UPDATE_INCOMPATIBLE:软件包io.ionic.starter签名与先前安装的版本不匹配;忽略!]

  

您的软件包名称现在为“ io.ionic.starter”

您的构建成功,但是您已经安装了具有相同封装名称的apk,因此请在cofig.xml第2行中更改您的应用程序包名称

defaultConfig {
    ...
    vectorDrawables.useSupportLibrary = true
}

答案 1 :(得分:0)

  

首先从设备上卸载应用程序,然后重试。

如果使用不同的计算机或不同的开发环境在手机上安装了该应用的构建版本,则通常会遇到您遇到的问题(例如,如果您重新安装了所有软件)