目录

INSTALL_FAILED_INVALID_APK: /data/app/**.tmp/*_slice__ signatures are inconsistent 解决方法

目录

刚刚作项目碰到了签名之后程序安装失败的问题,记录一下解决方法。

实际上,错误的代码如下:

1
2
3
4
5
6
Installation failed with message Failed to finalize session : INSTALL_FAILED_INVALID_APK: /data/app/vmdl1909831784.tmp/3_slice__ signatures are inconsistent.
It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

具体原因不明,暂时推测是因为签名之前残留部分 build 产物,而签名之后 build 时没有重新生成,导致签名出现冲突。 解决方法很简单:使用 Gradle 的 clean 任务清理整个项目,重新 build 即可。