INSTALL_FAILED_CONFLICTING_PROVIDER Android中 [英] INSTALL_FAILED_CONFLICTING_PROVIDER in Android

查看:222
本文介绍了INSTALL_FAILED_CONFLICTING_PROVIDER Android中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用从谷歌开放式srouce code名为MyTracks的应用程序。

我收到此错误时,原来的应用程序是安装在手机上。

  INSTALL_FAILED_CONFLICTING_PROVIDER
 

我知道,这是因为的android:在清单当局

这里是清单的一部分:

 <供应商
机器人:名称=com.google.android.apps.mytracks.content.MyTracksProvider
机器人:当局=com.google.android.maps.mytracks
机器人:出口=真
机器人:readPermission =com.google.android.apps.mytracks.READ_TRACK_DATA
机器人:writePermission =com.google.android.apps.mytracks.WRITE_TRACK_DATA/>
<  - !搜索建议提供者 - >
<供应商
机器人:名称=com.google.android.apps.mytracks.content.SearchEngineProvider
机器人:当局=com.google.android.maps.mytracks.search
机器人:出口=FALSE/>
 

所以,我的问题是:我想知道这种做法是否可以解决问题或没有,因为我害怕改变所有包的名字,然后让整个应用程序破碎

  1. 安卓当局值是软件包的名称。该安卓名称是类供应商的名称。 对吗?

如果我更改包名,到另一个比com.google ETX不同,并重新命名该包的所有引用/进口,应该问题消失?

解决方案
  

Android的:当局值为包名

在这种情况下,它的发生的包名。它只是必须是唯一的。

  

在Android:名称是类供应商

的名称

正确的。

  

如果我更改包名,到另一个比com.google ETX不同,并重新命名该包的所有引用/进口,应该问题消失?

包名有什么用它做。您可能需要更改为好,不过,你的应用程序才能够被一起安装常规的,未修饰的应用程序。

您需要有 Android的一个独特的价值:当局使用该的ContentProvider 需要使用适当的乌里内容://whatever.you.change.the.authority.to ​​/ ... )。

I am using an open-srouce code from Google for an app called MyTracks.

I am getting this error when the original app is installed on the phone.

INSTALL_FAILED_CONFLICTING_PROVIDER

I know that this is because of the android:authorities in the Manifest.

here is the part of the Manifest:

<provider
android:name="com.google.android.apps.mytracks.content.MyTracksProvider"
android:authorities="com.google.android.maps.mytracks"
android:exported="true"
android:readPermission="com.google.android.apps.mytracks.READ_TRACK_DATA"
android:writePermission="com.google.android.apps.mytracks.WRITE_TRACK_DATA" />
<!-- Search suggestion provider -->
<provider
android:name="com.google.android.apps.mytracks.content.SearchEngineProvider"
android:authorities="com.google.android.maps.mytracks.search"
android:exported="false" />

So, my question is: I want to know whether this approach may solve the problem or not, because I am afraid of changing all the packages names and then have the whole app broken.

  1. The android :authorities value is the package name. The android:name is the name of the class of that provider. Am I correct?

If I change the package name, to another one different than the com.google etx, and rename all the references/ imports of that package, should the problem go away?

解决方案

The android :authorities value is the package name.

In this case, it happens to be the package name. It simply has to be unique.

The android:name is the name of the class of that provider

Correct.

If I change the package name, to another one different than the com.google etx, and rename all the references/ imports of that package, should the problem go away?

The package name has nothing to do with it. You may need to change that as well, though, for your app to be able to be installed alongside the regular, un-modified app.

You need to have a unique value for android:authorities, and the code in your app that uses this ContentProvider needs to use an appropriate Uri (content://whatever.you.change.the.authority.to/...).

这篇关于INSTALL_FAILED_CONFLICTING_PROVIDER Android中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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