我正在使用Android SDK中的NotesList示例程序进行试验。我在程序中做了轻微的更改,但是当我安装我的编辑版本时,当我尝试在设备上已经安装原始notes程序时,我在控制台中一直得到消息INSTALL_FAILED_CONFLICTING_PROVIDER。我需要在提供者中更改什么以使其成为唯一的数据库?如果我卸载原来的notes程序,然后安装我编辑过的版本,它就可以正常工作。
当前回答
我有这个错误,当实现一个库与以下AndroidmManifest.xml
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="library.path.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
当我在Project AndroidManifest.xml (app/src/main)中放入以下代码时,我解决了这个问题:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true"
tools:replace="android:authorities">
</provider>
其他回答
我尝试了很多方法,但都没有找到一个解决方案: 我在AndroidManifest中修改了这个
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="com.com.shareFile"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>
这是显而易见的,但也要确保你没有在android中混淆了对applicationId的引用:权威。
在我的例子中,我犯了一个错误,漏掉了该死的美元符号:
android:authorities="{applicationId}.myprovider"
而不是:
android:authorities="${applicationId}.myprovider"
这不会立即导致任何错误(因为它是有效的权威名称)。但几天后,当我尝试安装一个应用程序的不同变体时,要了解错误是什么真的很痛苦,因为错误消息没有提供关于内容提供者错误的太多信息。
解决此问题的另一种方法是比较合并的清单,寻找相同的权限。
我遇到了这样的问题:
Installation did not succeed.
The application could not be installed: INSTALL_FAILED_CONFLICTING_PROVIDER
但它不是来自舱单供应商 我的应用程序中的以下库与其他应用程序有冲突,其他应用程序无法安装:
implementation 'com.iceteck.silicompressorr:silicompressor:2.2.1'
如果你在Xamarin上,你得到这个错误(可能是因为Firebase.Crashlytics):
INSTALL_FAILED_CONFLICTING_PROVIDER
Package couldn't be installed in [...]
Can't install because provider name dollar_openBracket_applicationId_closeBracket (in package [...]]) is already used by [...]
正如这里提到的,你需要更新Xamarin.Build.Download:
Update the Xamarin.Build.Download Nuget Package to 0.4.12-preview3 On Mac, you may need to check Show pre-release packages in the Add Packages window Close Visual Studio Delete all cached locations of NuGet Packages: On Windows, open Visual Studio but not the solution: Tools -> Option -> Nuget Package Manager -> General -> Clear All Nuget Cache(s) On Mac, wipe the following folders: ~/.local/share/NuGet ~/.nuget/packages packages folder in solution Delete bin/obj folders in solution Load the Solution Restore Nuget Packages for the Solution (should run automatically) Rebuild
我尝试了很多方法,但都没有找到解决方法。但是这个链接帮助了我……我想详细谈谈……
我正在运行Instrumented测试用例,所以我的应用程序在启动器中不可见…但它是安装的,因此使用相同的内容提供程序。所以,我应该卸载它。所以设置->应用程序管理器->所有下载的应用程序->卸载所有应用程序从您当前的开发包
现在,试着跑……这会有用的……
推荐文章
- 警告:API ' variable . getjavacompile()'已过时,已被' variable . getjavacompileprovider()'取代
- 安装APK时出现错误
- 碎片中的onCreateOptionsMenu
- TextView粗体通过XML文件?
- 如何使线性布局的孩子之间的空间?
- DSL元素android.dataBinding。enabled'已过时,已被'android.buildFeatures.dataBinding'取代
- ConstraintLayout:以编程方式更改约束
- PANIC: AVD系统路径损坏。检查ANDROID_SDK_ROOT值
- 如何生成字符串类型的buildConfigField
- Recyclerview不调用onCreateViewHolder
- Android API 21工具栏填充
- Android L中不支持操作栏导航模式
- 如何在TextView中添加一个子弹符号?
- PreferenceManager getDefaultSharedPreferences在Android Q中已弃用
- 在Android Studio中创建aar文件