Reputation: 179
I've recently copy and paste an old android application project in Eclipse. Thereafter I made some changes to the project including refactor>rename the project, both the project name and the package name as well. All seems ok so far when running this modified duplicate project in the emulator without any problems.
But when I tried to run it on my device (from Eclipse), it does not work, as the original old android application project is installed on the device.
Eclipse prompts 'Re-Installation failed due to different application signatures. You must perform a full uninstall of the application. WARNING: This will remove the application data! Do you want to uninstall?'
I didn't.
But I exported an unsigned apk of the duplicate modified project and tried to install it on the device and it fails again. I uninstall the old application and tried reinstalling the duplicate modified project, and it fails again.
I'm not sure why as the project name and package names are different from the original. Also, I notice the duplicate modified project is nearly 40Mb compared to the original of only 8MB. If its a copy of the original (plus some minor changes, which are really reductions actually), how did it get so large? I checked that in the folders of the duplicate modified project, I saw that its dexlibs folder has the original APK of the original project (with the original project name and package name) in it. I did some research online and they say to ignore it.
In the APK of the duplicate modified project, surely enough, it is, as expected, smaller that the original version APK. But how come it doesn't install, and in installing, it still uses the name of the original projects package name instead of the new duplicate modified name?
Please help.
Upvotes: 0
Views: 1039
Reputation: 6697
All you need is run below commands in your command shell make sure adb path is set in your system PATH
adb uninstall your_package_name
adb install path_to_apk
Upvotes: 0
Reputation: 14274
It appears you're trying to install a duplicate app with a different signature on the same device. You either need to make the app "different," that is, change the package name (in Eclipse, under Android Tools/Rename Application Package); or you need to find the same key you've used before to sign the app -- this may well be a debug key, and it's most likely expired now.
If you change the package name, the new version of the app will not have access to the data from the old version of the app. If you find the old key, and it's expired, you might be able to coax Android into accepting it by setting the date on the PC and the device back.
Upvotes: 0