在Eclipse中运行Android ApiDemos时出现问题

twe*_*ter 7 android

我在Eclipse(在Windows 7中)中使用ApiDemo示例代码创建了一个项目,如下所述:http: //developer.android.com/resources/samples/get.html

当我尝试运行项目时,我得到以下输出:

[2011-03-23 01:59:39 - ApiDemos] Uploading ApiDemos.apk onto device 'emulator-5554'
[2011-03-23 01:59:44 - ApiDemos] Installing ApiDemos.apk...
[2011-03-23 02:01:24 - ApiDemos] Re-installation failed due to different application signatures.
[2011-03-23 02:01:24 - ApiDemos] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2011-03-23 02:01:24 - ApiDemos] Please execute 'adb uninstall com.example.android.apis' in a shell.
[2011-03-23 02:01:24 - ApiDemos] Launch canceled!
Run Code Online (Sandbox Code Playgroud)

然后打开仿真器并出现锁定屏幕.我解锁它并打开应用程序面板,ApiDemos图标就意味着它已经安装.我打开它,它工作正常,即所有演示工作.我的问题是为什么我会遇到有关重新安装失败的上述错误?为什么发布会被取消?当我在cmd窗口中运行adb uninstall命令时它成功,然后我再次在Eclipse中运行应用程序,它安装并启动正常.这里发生了什么?

Ebo*_*ike 5

编译APK文件时,它将使用您自己的调试密钥进行签名.此密钥不同于之前用于创建先前版本的API演示的密钥.

您无法使用其他密钥替换现有应用.这部分是为了防止冒名顶替的应用程序覆盖现有应用程序.