INSTALL_FAILED_CONFLICTING_PROVIDER安装失败错误

Installation failed with message INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /data/app/com.QQ-2: Can't install because provider name com.huawei.hms.example.hms.update.provider (in package com.包名) is already used by com.包名.
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?
场景:用户卸载后,再安装就安装不上了,机型是7.0。本来以为是android版本问题,后来又有一个5.0的手机安装不上。然后拿测试的7.0和5.0手机都发现不了问题。最后把客户的手机拿过来,直接在AS上安装,结果报如上错误。后经过排查,发现项目里为了适配华为推送,添加了HMS-SDK包,然后再清单文件中注册了Provider,这都没什么问题,问题出在provider的authorities属性上,这个需要唯一的名字,一般都是自己包名或者包名.fileprovider,而当初直接复制过来就没改,结果用户手机某一款应用也没改这个东西,然后就出现了“先来的能装上,后来的装不上”的问题。改完authorities,就能安装了

你可能感兴趣的:(android问题)