Cordova:将android升级到5.1.1 Nexus 5后无法安装apk

时间:2015-05-28 09:23:49

标签: android cordova phonegap-build

升级到5.1.1后无法在nexus 5上运行apk

使用Cordova:5.0.0 设备:Nexus 5 机器:MAC

BUILD SUCCESSFUL

Total time: 8.432 secs
Built the following apk(s):
    /Applications/XAMPP/xamppfiles/htdocs/android/kaljacobs/platforms/android/build/outputs/apk/android-debug.apk
Using apk: /Applications/XAMPP/xamppfiles/htdocs/android/kaljacobs/platforms/android/build/outputs/apk/android-debug.apk
Installing app on device...

/Applications/XAMPP/xamppfiles/htdocs/android/kaljacobs/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
ERROR: Failed to launch application on device: ERROR: Failed to install apk to device:  pkg: /data/local/tmp/android-debug.apk
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

ERROR running one or more of the platforms: Error: /Applications/XAMPP/xamppfiles/htdocs/android/kaljacobs/platforms/android/cordova/run: Command failed with exit code 8
You may not have the required environment or OS to run this project

2 个答案:

答案 0 :(得分:83)

我认为您遇到此问题,因为该应用已在您的设备上安装了不同的签名。

当你执行cordova运行android时,应用程序安装了一个调试签名,当你改变目标sdk或升级android时,这个签名可能会改变。

当您遇到INSTALL_FAILED_UPDATE_INCOMPATIBLE错误时,修复是首先卸载您的应用,然后在启动cordova run android

时不应再出现此问题

答案 1 :(得分:3)

不要担心。对于NEXUS 5.go到设置>>应用和GT;>搜索应用程序。

enter image description here

enter image description here enter image description here

干得好......