出现"已安装了存在签名冲突的同名数据包"的原因及解决办法


果你在android上更新一个已经安装过较早版本软件时,安装到最后一步提示你:已安装了存在签名冲突的同名数据包,然后安装失败。这是因为旧版软件的签名信息与新版不一致造成的。你可以卸载这个软件,然后安装新版软件。

如果无法卸载,可能手机(pad)在发售前将该软件内置在手机中无法卸载。如果是这个原因的话,你可以尝试“root”系统,然后卸载掉该软件的旧版本,然后安装。

 

如果你是一个开发人员,那么出现这个问题可能是因为,较旧的版本你是使用eclipse自动发布到模拟器上的,而eclipse自动发布时使用的是一个测试用签名,这个签名与你正式打包的签名不是一个。(这个问题一般发生在测试自动更新功能上,嘿嘿)。想继续测试自动更新,解决的办法也很简单,手工删除该软件的旧版(eclipse自动安装的那个),然后使用adb工具安装旧版再测试新版就好。自动更新的安装代码一般是这样:

Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.parse("file://" + apkfile.toString()),
"application/vnd.android.package-archive");
mContext.startActivity(i);

或许你和这略有不同,不用担心,没什么,问题不在这里。

 

下面是给外国朋友的,请原谅我蹩脚的英语:

for foreigner,please forgive my broken:

 

When you try install a new version of a software on android, maybe you will receive this message: an existing package by the same name with a conficting signature is already installed!

 

I take it easy! Uninstall old version soft, and then install new version. In this process , maybe you need get "root" popedom.

 

If you are developer, you receive this message maybe because the old version is install by the eclipse. Eclipse use a debug keystore signature.  I guess you try test you autoupdate function. You can uninstall it (eclipse auto package version) in setting tool. And install the old version (which you signature package) by ADB.exe before you test autoupdate function. 

 

Autoupdate function code always like this:

 

Intent i = new Intent(Intent.ACTION_VIEW);
i.setDataAndType(Uri.parse("file://" + apkfile.toString()),
"application/vnd.android.package-archive");
mContext.startActivity(i);

 

If you code not like this , dont worry , never mind,  the question not in there.

:)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值