2011-03-23 73 views
7

运行Android ApiDemos我在Eclipse中创建了一个项目从ApiDemo示例代码(在Windows 7中)如下所述: http://developer.android.com/resources/samples/get.html问题在Eclipse

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

[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! 

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

回答

5

当您编译APK文件时,它将使用您自己的调试密钥进行签名。这个键不同于你之前在你的模拟器镜像中创建过的API演示版本的键。

您无法用不同的密钥替换现有的应用程序。这部分是为了防止冒名顶替的应用程序覆盖现有的应用程序。

+0

对我来说,这意味着从我的测试手机中删除原来的演示应用程序 – 2012-08-04 07:09:53