Google Play服务和“重复提供商授权”

时间:2016-02-23 13:44:19

标签: android gradle google-play google-play-services

我使用的是Google Play Services 7.8,我更新到最新版本8.4,所有测试设备上的一切都很好。但是,某些用户(极少数用户)在尝试安装或更新到最新版本时报告错误Duplicate Provider Authority

在用户的帮助下,我将其缩小为由Google Play服务引起的,但我无法弄清楚它为何会发生或确切原因。

我的.gradle依赖项是:

dependencies {
    compile 'com.facebook.android:facebook-android-sdk:4.10.0'
    compile ('com.facebook.android:audience-network-sdk:4.10.0') {
        exclude group: 'com.google.android.gms'
    }
    compile 'com.android.support:support-v4:23.1.1'
    compile 'com.google.android.gms:play-services-games:8.4.0'
    compile 'com.google.android.gms:play-services-analytics:8.4.0'
    compile 'com.google.android.gms:play-services-ads:8.4.0'
    compile 'com.google.android.gms:play-services-plus:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'com.google.android.gms:play-services-location:8.4.0'
    compile 'com.android.support:multidex:1.0.1'
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.amazon.android:mobile-ads:5.+'
}

运行gradlew android:androidDependencies会产生以下输出

+--- LOCAL: gameanalytics.jar
+--- LOCAL: in-app-purchasing-2.0.61.jar
+--- LOCAL: vungle-publisher-adaptive-id-3.3.3.jar
+--- LOCAL: dagger-1.2.2.jar
+--- LOCAL: nineoldandroids-2.4.0.jar
+--- LOCAL: presage-lib-1.7.2-manual.jar
+--- LOCAL: javax.inject-1.jar
+--- com.android.support:multidex:1.0.1
+--- com.facebook.android:facebook-android-sdk:4.10.0
|    +--- com.android.support:support-v4:23.1.1
|    |    \--- LOCAL: internal_impl-23.1.1.jar
|    \--- com.android.support:cardview-v7:23.1.1
+--- com.facebook.android:audience-network-sdk:4.10.0
|    +--- com.android.support:appcompat-v7:23.1.0
|    |    \--- com.android.support:support-v4:23.1.1
|    |         \--- LOCAL: internal_impl-23.1.1.jar
|    \--- com.android.support:recyclerview-v7:23.1.0
|         \--- com.android.support:support-v4:23.1.1
|              \--- LOCAL: internal_impl-23.1.1.jar
+--- com.android.support:support-v4:23.1.1
|    \--- LOCAL: internal_impl-23.1.1.jar
+--- com.google.android.gms:play-services-games:8.4.0
|    +--- com.google.android.gms:play-services-base:8.4.0
|    |    \--- com.google.android.gms:play-services-basement:8.4.0
|    |         \--- com.android.support:support-v4:23.1.1
|    |              \--- LOCAL: internal_impl-23.1.1.jar
|    \--- com.google.android.gms:play-services-drive:8.4.0
|         \--- com.google.android.gms:play-services-base:8.4.0
|              \--- com.google.android.gms:play-services-basement:8.4.0
|                   \--- com.android.support:support-v4:23.1.1
|                        \--- LOCAL: internal_impl-23.1.1.jar
+--- com.google.android.gms:play-services-analytics:8.4.0
|    \--- com.google.android.gms:play-services-basement:8.4.0
|         \--- com.android.support:support-v4:23.1.1
|              \--- LOCAL: internal_impl-23.1.1.jar
+--- com.google.android.gms:play-services-ads:8.4.0
|    \--- com.google.android.gms:play-services-basement:8.4.0
|         \--- com.android.support:support-v4:23.1.1
|              \--- LOCAL: internal_impl-23.1.1.jar
+--- com.google.android.gms:play-services-plus:8.4.0
|    \--- com.google.android.gms:play-services-base:8.4.0
|         \--- com.google.android.gms:play-services-basement:8.4.0
|              \--- com.android.support:support-v4:23.1.1
|                   \--- LOCAL: internal_impl-23.1.1.jar
+--- com.google.android.gms:play-services-gcm:8.4.0
|    +--- com.google.android.gms:play-services-base:8.4.0
|    |    \--- com.google.android.gms:play-services-basement:8.4.0
|    |         \--- com.android.support:support-v4:23.1.1
|    |              \--- LOCAL: internal_impl-23.1.1.jar
|    \--- com.google.android.gms:play-services-measurement:8.4.0
|         \--- com.google.android.gms:play-services-basement:8.4.0
|              \--- com.android.support:support-v4:23.1.1
|                   \--- LOCAL: internal_impl-23.1.1.jar
\--- com.google.android.gms:play-services-location:8.4.0
     +--- com.google.android.gms:play-services-base:8.4.0
     |    \--- com.google.android.gms:play-services-basement:8.4.0
     |         \--- com.android.support:support-v4:23.1.1
     |              \--- LOCAL: internal_impl-23.1.1.jar
     \--- com.google.android.gms:play-services-maps:8.4.0
          \--- com.google.android.gms:play-services-base:8.4.0
               \--- com.google.android.gms:play-services-basement:8.4.0
                    \--- com.android.support:support-v4:23.1.1
                         \--- LOCAL: internal_impl-23.1.1.jar

1 个答案:

答案 0 :(得分:0)

据我所知,当使用提供程序权限(提供程序名称)时会发生此错误。如果应用程序的build.gradle文件没有applicationId,则库包名称将用作默认值。如果应用程序尚未完全从设备中删除,则会遇到此问题。

我建议如下:

  • 更改build.gradle中的applicationId
  • 建议用户通过转到应用程序管理器确保应用程序完全删除,如果看到应用程序图标并显示为灰色,则将其删除

请参阅以下答案以获取更多信息:

android duplicate provider authority on apps that don't have provider

希望这有帮助