Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
297 views
in Technique[技术] by (71.8m points)

android - 'dependencies' cannot be applied to '(groovy.lang.Closure)'

I am unable to fix this error:

dependencies cannot be applied to '(groovy.lang.Closure)

This is my gradle file:

buildscript {
     repositories {
         maven { url 'http://download.crashlytics.com/maven' }
     }

     dependencies {
         classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.+'
     }
 }
apply plugin: 'android'
apply plugin: 'crashlytics'

repositories {
   maven { url 'http://download.crashlytics.com/maven' }
}

dependencies {
    compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
    compile fileTree(dir: 'libs', include: '*.jar')
    compile project(':FRNDzTER_core')
    compile project(':cropper')
    compile project(':stickyListHeaders')
    compile "com.nostra13.universalimageloader:universal-image-loader:${rootProject.universalImageLoaderVersion}"
    compile "com.google.android.gms:play-    services:${rootProject.googlePlayServicesVersion}"
    compile "de.keyboardsurfer.android.widget:crouton:${rootProject.croutonVersion}"
    compile "com.nineoldandroids:library:${rootProject.nineoldandroidsVersion}"
    compile 'com.github.chrisbanes.actionbarpulltorefresh:library:+'
    compile 'com.crashlytics.android:crashlytics:1.+'
}

android{
    compileSdkVersion rootProject.compileSdkVersion
    buildToolsVersion rootProject.buildToolsVersion
    defaultConfig {
        minSdkVersion rootProject.minSdkVersion
        targetSdkVersion rootProject.targetSdkVersion
        versionCode rootProject.versionCode
        versionName rootProject.versionName
    } 
    buildTypes {
        release {
            debuggable rootProject.prodDebug
            proguardFile 'proguard.cfg'
        }
    }

    dependencies {
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    lintOptions {
        abortOnError false
    }
 }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can go to Preferences and select "use default gradle wrapper" then rebuild the project. It worked well for me: enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...