0

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.

user3492802
  • 179
  • 9
  • 1
    possible duplicate of [Android App Not Install. An existing package by the same name with a conflicting signature is already installed](http://stackoverflow.com/questions/19959890/android-app-not-install-an-existing-package-by-the-same-name-with-a-conflicting) – 323go Feb 25 '15 at 14:42
  • 1
    Did you update the package name in your manifest? – Chris Stratton Feb 25 '15 at 14:46
  • Thanks. You nailed the problem exactly. I changed the manifest package to the new package name and tested it with device via eclipse and it works. Can't believe I miss that (I changed all the package names in the manifest in the tags but forgot about the main one.) Thanks a lot. Saved me from a lot of head scratching. If you'll put your pointed as the answer, i'll make it the answer. – user3492802 Feb 25 '15 at 14:59
  • After changing the package name in the manifest, and after running successfully on the device via eclipse, i tried exporting to apke and reinstalling on the device directly. this time it doesnt work and said app not installed. further the name shown when installing in device is still the old package name. – user3492802 Feb 25 '15 at 23:15
  • what else am i forgetting? – user3492802 Feb 25 '15 at 23:16

3 Answers3

1

You have to remove the app from device and run again.

Alican Temel
  • 1,318
  • 13
  • 13
0

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.

323go
  • 14,143
  • 6
  • 33
  • 41
0

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
Akhil
  • 6,667
  • 4
  • 31
  • 61