【问题标题】:Android - Problem with <provider> INSTALL_FAILED_CONFLICTING_PROVIDERAndroid - <provider> INSTALL_FAILED_CONFLICTING_PROVIDER 的问题
【发布时间】:2019-10-11 03:16:16
【问题描述】:

我在我的项目中使用了不同的口味,我不得不使用一些代码将图片保存在我的内部存储中。

我阅读的文档/链接说我必须把它放在我的 android 清单中:

 <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="com.q4tech.magazine.fileprovider"
        android:grantUriPermissions="true"
        android:exported="false">
        <meta-data
            android:name="android.support.FILE_PROVIDER_PATHS"
            android:resource="@xml/filepaths" />
    </provider>

完美运行。我可以毫无问题地保存图片但现在我无法在我的手机中安装其他口味,因为这个错误:

10/10 15:46:45:在三星 SM-G9650 上启动“应用程序”。 安装没有成功。 无法安装应用程序:INSTALL_FAILED_CONFLICTING_PROVIDER 安装失败,原因是:'null' 重试

我不知道还能做什么。我不明白这个问题。

【问题讨论】:

  • 在我使用com.freshdesk.helpdesk.provider this 的情况下,我遇到了同样的问题,我在提供者标签android:authorities="${applicationId}.com.freshdesk.helpdesk.provider" 中设置了这一行,但仍然面临同样的问题注意:- 有味道

标签: android


【解决方案1】:

你们的口味有不同的包装名称吗?如果是,它们将在不卸载以前的版本的情况下安装。所有风味都将尝试以相同的权限注册Provider(在您的情况下为com.q4tech.magazine.fileprovider)。

卸载以前的版本应该可以解决问题。但是,如果您想在单个设备上同时安装多种风格,您可以使 authorities 特定于包,如下所示:

<provider
...
android:authorities="${applicationId}.fileprovider"/>

【讨论】:

  • 哪个是正确的android:authorities="${applicationId}.fileprovider" 或这个android:authorities="${applicationId}.com.q4tech.magazine.fileprovider"
  • @Arbaz.in 两者都应该可以正常工作,因此由您决定选择哪一个。在这种情况下,重要的是使用${applicationId},因为它在不同的风格中是不同的。
  • 在某些类文件中我的硬编码packeg确实存在问题,感谢您的响应
猜你喜欢
  • 1970-01-01
  • 2013-05-17
  • 1970-01-01
  • 1970-01-01
  • 2012-01-21
  • 2020-06-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多