3

I want to provide an updated version to my app,

It is downloaded from my site not from google play service. When I download the updated version its not replacing the old version, instead it shows error"An existing package by the same name with conflicting signature".

Is there any solution to replace the app without manually un-installing the older version from the device.

Nik
  • 111
  • 2
  • 8
  • do you have written any code for updating the exiting apk if new version is available? – Sree May 05 '14 at 11:08

4 Answers4

1

Every android application file – apk has two main things:

  1. package name – (unique id of app like com.example.application)
  2. signature

More information about the second. Every apk file should be signed with developer keystore. If this is the debug version it could be debug-keystore. In this keystore there are some information about developer and other information.

When you install application android system at first checks package name – whether or not this application have been installed already. And if so system checks signatures. The signature of installed app and app to be installed must be the same. Otherwise you will get error, you describe in your question.

So, the answer is: not, you can't install another application with the same package name if the signatures of installed and to be installed apps are different. You must uninstall previous version and install new version, if you need new version.

krossovochkin
  • 12,030
  • 7
  • 31
  • 54
  • is there any way to find the older version signature and use it in the updated version. – Nik May 05 '14 at 11:36
  • 1
    If you find .keystore with which old apk was signed, then you can resign this apk. See for more information: http://stackoverflow.com/questions/3267216/can-i-resign-an-apk-with-a-different-certificate-than-what-it-came-with – krossovochkin May 05 '14 at 11:39
0

Yes, the error message already describes your issue. Your issue is that your app is not signed with the same signature as the previous version.

So to prevent this error message you must sign the app with the same signature as the previous version.

More details about application signing can be found in the Android Developers documents.

miho
  • 11,765
  • 7
  • 42
  • 85
  • Yes, I agree. Make sure the keystore that you used to run your app is same as the keystore in upgraded version. – Prachi May 05 '14 at 11:13
  • In both version i have used only the default keystore but sysytem used for development differs and i have not signed the older version. – Nik May 05 '14 at 11:25
  • I don't get it what you mean with default keystore, but anyway: When your previous app hasn't been signed, updates are not possible since the system can't ensure that the new update is developed by the same entity. This is the reason, why you should **always** sign your apps. – miho May 05 '14 at 11:28
  • is there any way to delete the older version automatically using the package name during the installation of latest version. – Nik May 05 '14 at 13:03
  • 1
    No, there is no way. And if you find a way to do what you want, you may have found a serious vulnerability of Android. – miho May 07 '14 at 15:39
0

If That is Developed By You or a Developer.

Once Check weather the Entire Code and Package Names are Same or not, in the Manifest file..

If Its Not that app is not from you or your known developer means.
You need to Uninstall Previous Version and Install New One,

That Error You are Getting Is that App is Not Signed, means When we are Using UnSigned App It cannot Replace at the part of Signed app. first of all make your app as Signed.

Check more at Here

How to Make a App as self-Signed at here

-2

to protect the identity of the application each revision(update) requires the same signed key(SHA1) which was used for the earlier release. Eclipse by default uses debug-key to sign in all the packages.

Use the same method by which you first installed your app and everything should just work.

miho
  • 11,765
  • 7
  • 42
  • 85
Russell
  • 361
  • 1
  • 8
  • 24