找不到Gradle DSL方法:排除support-v4和/或commons-io时的'compile()'

时间:2015-08-06 13:08:50

标签: android android-studio gradle robospice

我的项目遇到了问题。我收到this错误,在应用了消化解决方案后,我收到this错误,但该解决方案不适用于我。这是我的build.gradle文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    packagingOptions {
        exclude 'META-INF/license.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }

    defaultConfig {
        applicationId "codechallenge.com.redditer"
        minSdkVersion 10
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

//configurations{
//    all*.exclude group: 'com.android.support', module: 'support-v4'
//}

repositories {
    maven {
        url "http://repo.mycompany.com/maven2"
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.1'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'org.codehaus.jackson:jackson-mapper-lgpl:1.9.13'
    compile 'org.codehaus.jackson:jackson-xc:1.9.13'
    compile 'com.fasterxml.jackson.core:jackson-core:2.6.0'
//    compile 'com.octo.android.robospice:robospice-cache:1.4.14'
//    compile 'com.octo.android.robospice:robospice:1.4.14'
//    compile 'com.octo.android.robospice:robospice-spring-android:1.4.14'


    compile ('com.octo.android.robospice:robospice-cache:1.4.14'){
        exclude module: 'support-v4'
        exclude group: 'org.apache.commons', module 'commons-io'
    }
    compile ('com.octo.android.robospice:robospice:1.4.14'){
        exclude module: 'support-v4'
        exclude group: 'org.apache.commons', module 'commons-io'
    }
    compile ('com.octo.android.robospice:robospice-spring-android:1.4.14'){
        exclude module: 'support-v4'
        exclude group: 'org.apache.commons', module 'commons-io'
    }
    compile 'commons-io:commons-ic:1.3.2'
}

也试过

compile ('com.octo.android.robospice:robospice-cache:1.4.14'){
    exclude module: 'support-v4'
    exclude group: 'org.apache.commons', module 'commons-io'
}
compile ('com.octo.android.robospice:robospice:1.4.14'){
    exclude module: 'support-v4'
    exclude group: 'org.apache.commons', module 'commons-io'
}
compile ('com.octo.android.robospice:robospice-spring-android:1.4.14'){
    exclude module: 'support-v4'
    exclude group: 'org.apache.commons', module 'commons-io'
}
complie 'commons-io:commons-ic:1.3.2'

非常感谢任何帮助

我的root build.gradle是:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'

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

allprojects {
    repositories {
        jcenter()
    }
}

0 个答案:

没有答案