为了使用JNI,我刚刚将我的项目迁移到gradle-experimental:0.4.0。我已经遵循了here的说明
该项目由一个库和一个应用程序组成。我不能绕过这个错误(尝试了通常的清理和无效缓存/重新启动):
Could not determine the dependencies of task ':myLibrary:transformClassesAndResourcesWithProguardForRelease'这个库构建得很好,但是在我构建app模块时出现了这个错误。以下是我修改后的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-实验版时看到了这个错误?
发布于 2016-03-20 21:15:42
好的,所以从库构建文件中删除proguard行修复了这个问题:
--proguardFiles.add(file('proguard.cfg'))https://stackoverflow.com/questions/36101110
复制相似问题