tags:

views:

58

answers:

1

Hi all,

I encounter an issue of INSTALL_FAILED_DUPLICATE_PACKAGE, when trying to deploy an apk into an emulator.

The following is the console display message:

[XXX] Installation error: INSTALL_FAILED_DUPLICATE_PACKAGE
[XXX] Please check logcat output for more details.
[XXX] Launch canceled!

However, when I check with the logcat, I saw a similar things here.

WARN/PackageManager(51): *************************************************
WARN/PackageManager(51): Application package com.xxx.xxx.xxx already installed.  Skipping duplicate.
WARN/PackageManager(51): *************************************************
WARN/PackageManager(51): Package couldn't be installed in /data/app/com.xxx.xxx.xxx.apk

When I open the ddms to check with whether the package is available, it is actually not available.

What I did before this is:

  1. Changing the android SDK location. (Window > Preferences > Android > SDK Location) Reason: Our team is customizing the android SDK, and I would like to point it into a new android SDK location instead of the default android SDK.

  2. After changing the android SDK location from Eclipse, the Build of the particular project does not completed.

    Note: I forgot the exact error, because it is not reproducible after one night. If not mistaken, the end of the compilation complains that the "aapt" in /platforms/android-7/tools is missing or could not execute. Note: Initially, it is my problem that do not set the "chmod" of the file properly. But after I change the chmod of "aapt", it is still not able to execute with same error.

  3. Therefore, I plan to check out my changes again from svn and migrate the changes to new location. After the migration to new location. Compilation is perfect and working fine, but problem occurs when trying to deploy and run in emulator.

Tested method:

  1. Using "ddms" to check the package, I could not see the mentioned package.

  2. Try remove blindly using "adb" command:

    ./adb shell rm data/app/$APK

    $APK is com.xxx.xxx.xxx.apk However, the return value is "failure"

  3. a. Changing the android SDK back to original SDK. b. Extract a new android SDK to use. c. Get a new eclipse to use. d. Get a new Android Emulator e. Restart PC...

All the method above has been tried, but no luck. Any suggestion? Currently, I would like to know how android check the duplicate package. Anyone can shed me some light on where is the explanation of this available?

Thank you for any kinds of help.

A: 

I'm not sure what you're doing in DDMS to see if it's installed or not, but to remove an APK you need to use the uninstall command in adb

adb uninstall com.your.root.package

It should then return

Success

if the APK is currently installed,

Failure

If not.

Try that and let me know if that solves your problems.

Chris Thompson
Thank you for your replies. Regarding the DDMS, I actually go to "Device > File Explorer > data > app" to check whether the package is installed.I actually try that command before the adb shell rm XXX.The return value is "Failure" also.I just found this from the android's troubleshooting page.http://developer.android.com/guide/appendix/faq/troubleshooting.html#gesturebuilderinstallMaybe the only choice I had is to choose another package name?
ccs
Update:I made changes to my application package following the guidelines in http://developer.android.com/guide/appendix/faq/troubleshooting.html#gesturebuilderinstall and it is able to deploy now. But I were left with the previous problem. If it occurs again, I may need to change the package namespace again. :(
ccs
Update: I would like like to know if there is any alternative solution that changing the namespace. If anyone has better solution?
ccs
Problem solved. The problem is occurred because our team is customizing the android SDK. The customized SDK already contains the apk in system application directory with different application name (Eg: /system/app/app.apk) but is using same namespace com.xxx.xxx.xxx. Because of this, I could not know find the installed application in /data/app.Thank you for helps.
ccs