0

I am unable to fix these warning for the following code:

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

property in 'org.gradle.api.Task' cannot be applied to '(java.lang.String, java.lang.String)

  sonarqube {
        properties {
            property "sonar.host.url", "http://localhost:9000"
            property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"
            property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"
        }
    }

tried all the solution mentioned below but non is working. 'dependencies' cannot be applied to '(groovy.lang.Closure)'

anyone know the cause.

Thanks in advance.

edit

import org.gradle.internal.os.OperatingSystem

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'findbugs'
apply from: '../jacoco.gradle'
apply plugin: 'spoon'
apply plugin: 'org.sonarqube'
apply plugin: 'net.researchgate.release'
apply plugin: 'io.fabric'
apply from: 'versioning.gradle'
apply plugin: 'maven-publish'

ext {
    appName = "xxxx"
    appDesc = "xxxx"
}

android {
    compileSdkVersion 24
    buildToolsVersion '24.0.1'
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.eurocarparks.exemption"
        minSdkVersion 19
        targetSdkVersion 24
        versionCode buildVersionCode()
        versionName version
    }

    signingConfigs {
        release {


        }
    }

    productFlavors {
        demo {

        }
        tst {

        }
        uat {

        }
        production {

        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
        debug {
            debuggable = true
            testCoverageEnabled = true
        }
    }

    lintOptions {
        abortOnError false
    }

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

    dexOptions {
        incremental true
        javaMaxHeapSize "5g"
    }
}


dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:support-v4:24.1.1'
    compile 'com.android.support:appcompat-v7:24.1.1'

    // JSON
    compile 'com.fasterxml.jackson.core:jackson-core:2.6.3'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.6.3'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.6.3'
    // RESTful
    compile 'com.squareup.retrofit:retrofit:1.9.0'
    compile 'com.squareup.okhttp:okhttp:2.4.0'
    compile 'com.squareup.okhttp:okhttp-urlconnection:2.4.0'
    compile 'com.squareup.retrofit:converter-jackson:1.9.0'
    compile('com.squareup.retrofit:converter-simplexml:1.6.1') {
        exclude group: 'stax', module: 'stax-api'
        exclude group: 'stax', module: 'stax'
        exclude group: 'xpp3', module: 'xpp3'
    }
    // Utilities
    compile 'com.google.guava:guava:19.0'
    // Event bus
    compile 'de.greenrobot:eventbus:2.4.0'
    // Database
    compile 'com.couchbase.lite:couchbase-lite-android:1.1.0'
    // Dependency injection
    compile 'com.jakewharton:butterknife:7.0.1'
    compile 'com.google.dagger:dagger:2.0.1'
    apt 'com.google.dagger:dagger-compiler:2.0.1'
    provided 'org.glassfish:javax.annotation:10.0-b28'
    // Commons IO
    compile 'commons-io:commons-io:2.4'
    // Unit test
    testCompile 'org.robolectric:robolectric:3.0'

    testCompile 'org.robolectric:shadows-support-v4:3.0'

    testCompile 'junit:junit:4.12'

    testCompile 'org.mockito:mockito-core:2.0.89-beta'
    testCompile 'org.assertj:assertj-core:1.7.1'
    testCompile 'com.google.dagger:dagger:2.0.1'
    testCompile 'org.skyscreamer:jsonassert:1.2.3'
    if (OperatingSystem.current().isMacOsX()) {
        println "OS: MacOsX"
        testCompile 'com.couchbase.lite:couchbase-lite-java-native-macosx:1.1.0'
    } else if (OperatingSystem.current().isLinux()) {
        println "OS: Jenkins"
        testCompile 'com.couchbase.lite:couchbase-lite-java-native-jenkins:1.1.0'
    } else if (OperatingSystem.current().isWindows()) {
        println "OS: Windows"
        testCompile 'com.couchbase.lite:couchbase-lite-java-native-windows:1.1.0'
    }
    testCompile('com.couchbase.lite:couchbase-lite-java:1.1.0') {
        exclude module: "couchbase-lite-java-native"
        exclude group: "com.fasterxml.jackson.core"
        exclude group: "commons-logging"
    }
    // Instrumentation test
    androidTestCompile 'junit:junit:4.12'
    androidTestCompile 'org.assertj:assertj-core:1.7.1'
    androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.6.0'
    androidTestCompile('com.squareup.spoon:spoon-runner:1.6.1') {
        exclude group: "commons-logging"
        exclude group: 'com.google.code.gson'
        exclude module: 'guava'
    }
    androidTestCompile('com.squareup.spoon:spoon-client:1.1.10') {
        exclude group: 'com.google.code.gson'
    }

    // Monitoring
    compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
        transitive = true;
    }

}



spoon {
    debug = true
    if (project.hasProperty("spoonDeviceSerials")) devices = [spoonDeviceSerials]
}


sonarqube {
    properties {
        property "sonar.host.url", "http://localhost:9000"
        property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"
        property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver"

    }
}

release {
    preTagCommitMessage = '[Release] - pre tag commit: '
    tagCommitMessage = '[Release] - creating tag: '
    newVersionCommitMessage = '[Release] - new version commit: '
    buildTasks = ['assembleTst', 'assembleUat', 'assembleProduction']
    git {
        requireBranch = ''
        pushToCurrentBranch = true
    }
}

afterReleaseBuild.dependsOn publish

publishing {
    repositories {    }
}
Community
  • 1
  • 1
user1154390
  • 2,331
  • 3
  • 25
  • 32
  • What versions of Gradle are you using? – OneCricketeer Aug 02 '16 at 13:08
  • Thanks I am using 2.13. – user1154390 Aug 02 '16 at 13:11
  • That's not the latest release, but regardless, what do your full build.gradle files look like? – OneCricketeer Aug 02 '16 at 13:13
  • please checked edited question. – user1154390 Aug 02 '16 at 13:24
  • Sorry, but I'm sure you could make that a [mcve], no? All those dependencies aren't related to the warning – OneCricketeer Aug 02 '16 at 13:32
  • thanks I am getting warning on following lines. sonarqube { properties { property "sonar.host.url", "http://localhost:9000" property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver" property "sonar.jdbc.driverClassName", "com.mysql.jdbc.Driver" } } – user1154390 Aug 02 '16 at 13:38
  • Yes, I read the question, and you've already mentioned that. Therefore, the *minimal* way to reproduce the problem is to only show `apply plugin: 'org.sonarqube'` and see that `sonarqube` doesn't contain a closure supporting a `properties` closure. In any case, it's just a warning, right? And it's annoying, but it isn't preventing you from building the app, so why bother? If it isn't broke,don't fix it – OneCricketeer Aug 02 '16 at 13:43
  • Yes u are right. I tired what you said earlier but still getting warnings. I can built the app. Only want to figure out the cause. Thanks for your time. – user1154390 Aug 02 '16 at 14:18

0 Answers0