安装在控制台中显示错误:INSTALL FAILED CONFLICTING PROVIDER [英] Install shows error in console: INSTALL FAILED CONFLICTING PROVIDER

查看:32
本文介绍了安装在控制台中显示错误:INSTALL FAILED CONFLICTING PROVIDER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在试验 Android SDK 中的 NotesList 示例程序.我对程序做了一些细微的改动,但是当我安装我编辑过的版本时,当我尝试安装它时,我一直在控制台中收到消息 INSTALL_FAILED_CONFLICTING_PROVIDER 当原始笔记程序已经在设备上时.我需要在 Provider 中更改什么才能使其成为唯一的数据库?如果我卸载原始笔记程序,然后安装我编辑过的版本,它就可以正常工作.

I am experimenting with the NotesList sample program in the Android SDK. I've made a slight variation in the program, but when I install my edited version I keep getting the message INSTALL_FAILED_CONFLICTING_PROVIDER in the console when I try to install it when the original notes program is already on the device. What do I need to change in the Provider to make it a unique database? It works fine if I uninstall the original notes program and then install my edited version.

推荐答案

android:authorities 中列出的权限必须是唯一的.引用此属性的文档:

The authority, as listed in android:authorities must be unique. Quoting the documentation for this attribute:

为避免冲突,权限名称应使用 Java 风格的命名约定(例如 com.example.provider.cartoonprovider).通常,它是实现提供者的 ContentProvider 子类的名称

To avoid conflicts, authority names should use a Java-style naming convention (such as com.example.provider.cartoonprovider). Typically, it's the name of the ContentProvider subclass that implements the provider

这篇关于安装在控制台中显示错误:INSTALL FAILED CONFLICTING PROVIDER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆