找不到方法packagingOption()

时间:2016-10-17 05:19:02

标签: android android-gradle

  

当我尝试转换为android时,这个项目是eclipse项目   工作室并在gradle文件中添加packagingOption它将显示给我   android studio 2.2中的轰鸣声错误我该如何修复它

Error:(23, 0) Could not find method packagingOption() for arguments [build_cgom5qnlyrf01zs8t9c0ozn8x$_run_closure1$_closure6@1333a698] on project ':kOOPSCv2' of type org.gradle.api.Project.

apply plugin: 'com.android.application'
android {
    compileSdkVersion 21
    buildToolsVersion '24.0.1'
    defaultConfig {
        applicationId "com.example.myapp"
        minSdkVersion 10
        targetSdkVersion 21
        versionCode 3
        versionName '1.2'
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
        }
    }
    productFlavors {}
    packagingOption{
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/notice.txt'
    }
}
dependencies {
    compile project(':kOOPSCv2FileChooser')
    compile files('libs/aquery.jar')
    compile files('libs/httpclient-4.3.3.jar')
    compile files('libs/httpcore-4.3.2.jar')
    compile files('libs/httpmime-4.3.3.jar')
}

1 个答案:

答案 0 :(得分:0)

packagingOption 一词改为 packagingOptions