Android:无法在Android 4.0(ICS)上以编程方式安装.apk

Android:无法在Android 4.0(ICS)上以编程方式安装.apk,android,apk,auto-update,android-4.0-ice-cream-sandwich,Android,Apk,Auto Update,Android 4.0 Ice Cream Sandwich,在这篇文章的帮助下。我已成功在我的Android 2.3设备上进行自动升级/自动安装: Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "app.apk")), "application/vnd.android.package-archive")

在这篇文章的帮助下。我已成功在我的Android 2.3设备上进行自动升级/自动安装:

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);
但它在Android 4.0(ICS)设备上失败,并向我发出错误消息:

an existing package by the same name with a conflicting signature is already installed
有什么不对劲吗


谢谢

这可能是因为您首先从Eclipse将应用程序运行到设备上(使用一个密钥对应用程序进行签名),然后通过从web下载apk文件(使用与Eclipse不同的密钥进行签名),尝试通过某个更新服务再次安装应用程序。这将导致签名冲突。

您是否更改了用于签署apk的证书?恐怕这不是因为签名冲突。两个apk文件都使用相同的密钥签名。和
adb安装-r new.apk
成功。如果密钥错误,它应该显示
失败[安装\u解析\u失败\u证书不一致]