2012年1月23日 星期一

[SOLVED] Please execute 'adb uninstall com.android.widgetpreview' in a shell

During Eclipse Development, you may find the following error when running the application.
Please execute 'adb uninstall com.android.





[2012-01-16 22:03:47 -WidgetPreview] New emulator found: emulator-5554
[2012-01-16 22:03:47 - WidgetPreview] Waiting for HOME ('android.process.acore') to be launched...
[2012-01-16 22:04:45 - WidgetPreview] WARNING: Application does not specify an API level requirement!
[2012-01-16 22:04:45 - WidgetPreview] Device API version is 15 (Android 4.0.3)
[2012-01-16 22:04:45 - WidgetPreview] HOME is up on device 'emulator-5554'
[2012-01-16 22:04:45 - WidgetPreview] Uploading WidgetPreview.apk onto device 'emulator-5554'
[2012-01-16 22:04:45 - WidgetPreview] Installing WidgetPreview.apk...
[2012-01-16 22:05:07 - WidgetPreview] Re-installation failed due to different application signatures.
[2012-01-16 22:05:07 - WidgetPreview] You must perform a full uninstall of the application. WARNING: This will remove the application data!
[2012-01-16 22:05:07 - WidgetPreview] Please execute 'adb uninstall com.android.widgetpreview' in a shell.
[2012-01-16 22:05:08 - WidgetPreview] Launch canceled!



Solution:
The error is due to the previous running of another android application. When running an Android application, Eclipse has to sign the application by the debug certificate. The existing cert is signed to the previous application and not allowed to install to the new application.

To resolve this problem, you have to uninstall the application by the adb uninstall command.
1. Open the command prompt
2. Go to the SDK directory \android-sdk\platform-tools\
3. Run the command adb uninstall com.android.widgetpreview
4. After that, you can run the application in the Eclipse again.


沒有留言:

張貼留言