android APK安装提示“解析错误,解析软件包时出现问题” 解析

android APK安装提示“解析错误,解析软件包时出现问题” 解析及优化

1.问题

项目产品在客户端升级的过程中遇到弹窗提示“解析错误,解析软件包时出现问题”,如下图。

在这里插入图片描述

2.分析过程

1.该弹窗内容,搜索项目工程代码,并无相关字眼,排除项目代码中的业务。

2.通过APK安装调用代码,可知安装行为,实为系统应用PackageInstaller中的业务

/** * 安装APK * @param file */
public static void installAPK(Context context,File file) {
      
    try {
         
        	Intent intent = new Intent();      			                                             intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);            				               intent.setAction("android.intent.action.VIEW");                                           intent.addCategory("android.intent.category.DEFAULT");                                   intent.setDataAndType(Uri.fromFile(file), "application/vnd.android.package-archive");      
            context.startActivity(intent);   
    } catch 
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值