首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Gradle build -无法确定任务':myLibrary:transformClassesAndResourcesWithProguardForRelease‘的依赖关系

Gradle build -无法确定任务':myLibrary:transformClassesAndResourcesWithProguardForRelease‘的依赖关系
EN

Stack Overflow用户
提问于 2016-03-19 19:26:04
回答 1查看 5.2K关注 0票数 1

为了使用JNI,我刚刚将我的项目迁移到gradle-experimental:0.4.0。我已经遵循了here的说明

该项目由一个库和一个应用程序组成。我不能绕过这个错误(尝试了通常的清理和无效缓存/重新启动):

代码语言:javascript
复制
Could not determine the dependencies of task ':myLibrary:transformClassesAndResourcesWithProguardForRelease'

这个库构建得很好,但是在我构建app模块时出现了这个错误。以下是我修改后的build.gradle脚本:

项目:

代码语言:javascript
复制
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle-experimental:0.4.0"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

库(内部版本正常):

代码语言:javascript
复制
apply plugin: 'com.android.model.library'

model
{
    android {
        buildToolsVersion="23.0.1"


        defaultConfig.with {
            minSdkVersion.apiLevel=16
            targetSdkVersion.apiLevel=16

            testInstrumentationRunner="android.test.InstrumentationTestRunner"
        }

    }

    android.buildTypes {
        release {
            minifyEnabled=true
            proguardFiles.add(file('proguard.cfg'))
        }
    }
}

应用程序(此构建失败):

代码语言:javascript
复制
apply plugin: 'com.android.model.application'

dependencies {
    compile files('libs/GoogleAdMobAdsSdk-4.1.1.jar')
    compile project(':myLibrary')
}


model
{
    android
    {
        compileSdkVersion='Google Inc.:Google APIs:16'
        buildToolsVersion="23.0.1"

        defaultConfig.with {
            applicationId="my.app.ID"
            minSdkVersion.apiLevel=16
            targetSdkVersion.apiLevel=16
        }

    }

    android.buildTypes {
        release {
            minifyEnabled=true
            proguardFiles.add(file('proguard.cfg'))
        }
    }
}

有没有人在迁移到gradle-实验版时看到了这个错误?

EN

回答 1

Stack Overflow用户

发布于 2016-03-20 21:15:42

好的,所以从库构建文件中删除proguard行修复了这个问题:

代码语言:javascript
复制
--proguardFiles.add(file('proguard.cfg'))
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/36101110

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档