我正在使用Android SDK中的NotesList示例程序进行试验。我在程序中做了轻微的更改,但是当我安装我的编辑版本时,当我尝试在设备上已经安装原始notes程序时,我在控制台中一直得到消息INSTALL_FAILED_CONFLICTING_PROVIDER。我需要在提供者中更改什么以使其成为唯一的数据库?如果我卸载原来的notes程序,然后安装我编辑过的版本,它就可以正常工作。


当前回答

使用adb命令安装。/adb Install -r abc.apk可以解决这个问题(即使设备的app版本更高,它也会被覆盖)

其他回答

我本以为通过拖拽图标到“卸载”来卸载应用程序就能解决问题,但事实并非如此。

下面是解决问题的方法:

进入设置 选择应用程序 找到你的应用(是的,我很惊讶仍然在这里找到它!)并按下它 在右上角,按下3个点 选择“卸载所有用户”

再试一次,现在应该可以工作了。

我在几个应用程序中使用一个库时遇到了类似的问题。有必要用下面的提供者声明更新你的AndroidManifest.xml。

<manifest ...>
    <application ...>
        <provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.here.this.library.provider" android:exported="false" android:grantUriPermissions="true" tools:replace="android:authorities">
        </provider>
    </application>  
</manifest> 

使用adb命令安装。/adb Install -r abc.apk可以解决这个问题(即使设备的app版本更高,它也会被覆盖)

重命名包后可能会出现相同的错误。从AndroidManifest.xml中检查android:权威的string.xml中的值。

<provider
        android:authorities="@string/content_authority"
        android:name=".data.Provider"
        ... />

在string.xml中,该值应该与manifest中声明的包名相同。

<string name="content_authority">com.whatever.android.sunshine.app</string>

我遇到了这样的问题:

Installation did not succeed.
The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER

但它不是来自舱单供应商 我的应用程序中的以下库与其他应用程序有冲突,其他应用程序无法安装:

implementation 'com.iceteck.silicompressorr:silicompressor:2.2.1'