Android Studio Run签名报错[signatures do not match the previously installed version;]

[Installation failed with message INSTALL_FAILED_UPDATE_INCOMPATIBLE: Package com.xxx.xxx signatures do not match the previously installed version; ignoring!.

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?]

问题:

        签名与先前安装的版本不匹配

原因:

        设备安装过带有签名的软件,一般卸载即可。

        有的设备仍然无法直接运行安装,依然报签名不匹配问题。

        但是正常打包之后带有签名的apk可以直接安装成功,给debug下增加签名即可。

解决:

        1. 打开“Build——>Edit Build Types”,默认Build Types提供两种构建模式:debug、release,这里我们处理debug;

        2.一般都是默认配置,重点是Signing Config选项,发现没有...去Signing中新建一个.

Android Studio Run签名报错[signatures do not match the previously installed version;]_第1张图片
Build Types

         3.准备好自己的应用签名文件。


Android Studio Run签名报错[signatures do not match the previously installed version;]_第2张图片
Signing

        4.填写好信息回到Build Types——选择Signing Config——选择刚才创建的Signing点击OK,项目自动Build...

        5.完成之后发现build.gradle中多出下图信息,再次点击Run运行项目发现,可以喽~


Android Studio Run签名报错[signatures do not match the previously installed version;]_第3张图片
build.gradle - signingConfigs


Android Studio Run签名报错[signatures do not match the previously installed version;]_第4张图片
build.gradle - buildTypes

你可能感兴趣的:(Android Studio Run签名报错[signatures do not match the previously installed version;])