简体   繁体   English

无法在Android模拟器上安装ApiDemos示例项目

[英]Cannot install ApiDemos sample project on Android emulator

I created ApiDemos project using Eclipse - New Project - Sample command. 我使用Eclipse-New Project-Sample命令创建了ApiDemos项目。 Trying to execute it on Android emulation, I got installation error. 尝试在Android仿真上执行它时,出现安装错误。 Then I opened data/app directory in the File Explorer, DDMS, and removed two files with name starting from ApiDemos (possibly this was incorrect, but this is done already). 然后,我在文件资源管理器DDMS中打开了data / app目录,并删除了两个以ApiDemos开头的文件(可能不正确,但已经完成了)。 Now, trying to execute my ApiDemos project, I have: 现在,尝试执行我的ApiDemos项目,我有:

[2011-11-15 16:23:19 - ApiDemos] Installation error: INSTALL_FAILED_UPDATE_INCOMPATIBLE
[2011-11-15 16:23:19 - ApiDemos] Please check logcat output for more details.
[2011-11-15 16:23:19 - ApiDemos] Launch canceled!

LogCat: LogCat:

package com.example.android.apis signatures do not match the previously installed version, ignoring!

Is it possible to correct this now? 现在可以纠正这个问题吗? I know that I can re-create emulator, but I would like to solve this problem with existing emulator, just to know how it should be done. 我知道我可以重新创建模拟器,但是我想用现有的模拟器解决此问题,只是想知道应该如何做。

uninstall the previous api demos by your adb command 通过adb命令卸载以前的api演示

adb -e uninstall com.example.android.apis

which installed in your emulator. 在您的模拟器中安装了哪个。

or try wipe user data while launching the emulator. 或尝试在启动模拟器时擦除用户数据。

First uninstall your application from the emulator: 首先从模拟器中卸载应用程序:

adb -e uninstall your.application.package.name adb -e卸载your.application.package.name

Then try to install the application again. 然后尝试再次安装该应用程序。

For me, with nexus 5 phone, the following command worked: 对我而言,使用nexus 5电话时,以下命令有效:

adb uninstall <Your_App_Package_Name>

so for your case, where package name is 'com.example.android.apis' 因此对于您的情况,包名称为“ com.example.android.apis”

adb uninstall com.example.android.apis

Other option is to go to the application manager. 另一种选择是转到应用程序管理器。 Navigate to the "All" tabs and scroll down to the bottom. 导航到“所有”标签,然后向下滚动到底部。 Select the application and then from the menu select - uninstall for all users. 选择应用程序,然后从菜单中选择-为所有用户卸载。

您也可以尝试使用“ uninstallAll” gradle任务来完全卸载应用程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM