首页 > 代码库 > Failed to collect certificates from /data/app/vmdl201020547.tmp/base.apk: META-INF/CERT.SF indicates /data/app/vmdl201020547.tmp/base.apk is signed using APK Signature Scheme v2, but no such signature
Failed to collect certificates from /data/app/vmdl201020547.tmp/base.apk: META-INF/CERT.SF indicates /data/app/vmdl201020547.tmp/base.apk is signed using APK Signature Scheme v2, but no such signature
错误信息:
12-26 11:08:44.809 1501-1535/system_process E/PackageInstaller: Commit of session 201020547 failed: Failed to collect certificates from /data/app/vmdl201020547.tmp/base.apk: META-INF/CERT.SF indicates /data/app/vmdl201020547.tmp/base.apk is signed using APK Signature Scheme v2, but no such signature was found. Signature stripped?
[ 12-26 11:08:44.813 1246: 1246 E/ ]
Couldn‘t opendir /data/app/vmdl201020547.tmp: No such file or directory
错误原因:
使用了网上常见的往META-INF放置空文件,标识渠道的做法,之前常见做法是先签名apk,然后放置标识渠道的文件,然后安装,这样做法在Android7.0以下是没有问题的,但是在Android7.0以上,就会出现问题,7.0+对签名做了改动,默认v2签名,就会出现安装失败,比如华为mate9,是Android7.0就会安装失败。
解决方案:
先打签名安装包,放置标识渠道的文件,然后再重新签名,这样就会安装成功了。之前的打多渠道安装包还是可以正常使用的。
顺便写了一个软件,打包更方便了。
参见:https://github.com/hpu-spring87/MultiSignTools
Failed to collect certificates from /data/app/vmdl201020547.tmp/base.apk: META-INF/CERT.SF indicates /data/app/vmdl201020547.tmp/base.apk is signed using APK Signature Scheme v2, but no such signature