0

我刚将项目迁移到gradle-experimental:0.4.0以使用JNI。我遵照指示hereGradle构建 - 无法确定任务的依赖关系:myLibrary:transformClassesAndResourcesWithProguardForRelease'

该项目包括一个库和一个应用程序。我不能避开这个错误(试图平时清洁和无效缓存/重新启动):

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时看到这个错误?

回答

0

好,以便消除从库构建文件ProGuard的线固定这样的:

--proguardFiles.add(file('proguard.cfg')) 
相关问题