1

With the help of this post "Android: install .apk programmatically". I have successfully made autoupgrade/autoinstall on my Android 2.3 device:

Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "app.apk")), "application/vnd.android.package-archive");
startActivity(intent);

But it failed on Android 4.0(ICS) devices and gave me the error message:

an existing package by the same name with a conflicting signature is already installed

What could be wrong?

Thanks!

Community
  • 1
  • 1
luciferleo
  • 349
  • 4
  • 8

1 Answers1

2

This could be because you first run your app to the device from Eclipse (which signs your app with one key) and then try to install it again via some update service by downloading an apk-file (signed with a different key than Eclipse does) from the web. That would cause conflicting signatures.

kaspermoerch
  • 16,127
  • 4
  • 44
  • 67
  • I am afraid this is not because the signature. Both of the apk files are signed with the same key. And `adb install -r new.apk` succeeded. If the key is wrong, it should display `Failure [INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES]`. – luciferleo Dec 13 '11 at 03:27