gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 04:33:31 26 4
gpt4 key购买 nike

我刚刚将我的项目迁移到 gradle-experimental:0.4.0 以使用 JNI。我已按照说明 here

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

Could not determine the dependencies of task ':myLibrary:transformClassesAndResourcesWithProguardForRelease'

该库构建良好,但是当我构建应用程序模块时出现此错误。这是我修改后的 build.gradle 脚本:

项目:
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()
}
}

库(构建确定):
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'))
}
}
}

应用程序(此构建失败):
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-experimental 时看到这个错误?

最佳答案

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

--proguardFiles.add(file('proguard.cfg'))

关于android - Gradle build - 无法确定任务 ':myLibrary:transformClassesAndResourcesWithProguardForRelease' 的依赖关系,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36101110/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com