Gradle DSL method not found: 'compile()' when excluding support-v4 and/or commons-io

北城以北 提交于 2019-12-12 00:26:53

问题


I am having trouble with my project. I was getting this error and after applying the sugested solution I am getting this error, however the solution does not apply to me. Here is my build.gradle file:

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'
}

Also tried

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'

Any help will be greatly appreciated

My root build.gradle is:

// 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()
    }
}

来源:https://stackoverflow.com/questions/31856703/gradle-dsl-method-not-found-compile-when-excluding-support-v4-and-or-common

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!