Problem running Android ApiDemos in Eclipse
I created a project from ApiDemo sample code in Eclipse (in Windows 7) as described here: http://developer.android.com/resources/samples/get.html
When I try running the project I get the following output:
[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!
The emulator then opens and the lock screen appears. I unlock it and 开发者_Go百科open the apps panel and the ApiDemos icon is there meaning it has been installed. I open it and it works fine i.e. all the demos work. My question is why do I get the above errors about reinstallation failure? And why does the launch get cancelled? When I run the adb uninstall command in a cmd window it succeeds and then I run the app again in Eclipse and it installs and launches fine. Whats going on here?
When you compile the APK file, it will be signed with your own debug key. This key differs from whichever key had been used to create the previous version of the API demo that you had on your emulator image before.
You cannot replace an existing app with a different key. This is in part to prevent imposter apps from overwriting existing apps.
精彩评论