包含名称的多个库

时间:2015-11-04 14:07:26

标签: java android gradle

我的Gradle依赖项包括:

compile'com.google.android.gms:play-services-gcm:8.1.0'
compile 'com.google.android.gms:play-services-analytics:8.1.0'
compile 'com.google.android.gms:play-services-ads:8.1.0

我遇到错误建议失败:

  

错误:任务':app:processDebugResources执行失败。   错误:多个包含包名称的库' com.google.android.gms'     您可以使用android.enforceUniquePackageName = false暂时禁用此错误   但是,这是暂时的,将在1.0

中强制执行

我该如何解决这个问题?

3 个答案:

答案 0 :(得分:2)

使用gradle androidDependencies了解重复的Google Play服务的来源。然后使用exclude过滤Gradle依赖项中的重复项,例如

compile('something.that.includes.google.play.services:1.2.3') {
    exclude group: 'com.google.android.gms'
}

答案 1 :(得分:2)

我遇到了同样的问题,我通过在Ctrl+Tab中添加此行android.enforceUniquePackageName = false来解决这个问题:

build.gradle(app)

答案 2 :(得分:-2)

最简单的方法是用整个包替换这些依赖项:

myApp.directive('myDir', function () {
    return {
        restrict: 'A',
        scope: {
            showDirective: '=myDir',
            updateMethod: '=', // this togheter does not work
        },
        link: function (scope, element, attrs) {

            this.routePanelUpdate = function (element) {
                //here the box should be visible

                scope.showDirective = true;
            };

            this[scope.updateMethod](element);
        }
  };
});

然后你可以编译它。

或者在 build.gradle 中添加compile 'com.google.android.gms:play-services:8.1.0'

android.enforceUniquePackageName = false
相关问题