1

Gradle says it's unable to find 'signingConfig()' method which is used to sign apk.

It also lists possible reasons:

1) The project may be using a version of gradle that doesn't contain it.

2) The build file may be missing a Gradle plugin.

Here's my grade.build:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "happy.blumental.maxim.testproject"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
    multiDexEnabled true
}

signingConfigs {
    release {
        keyAlias('releaseKey')
        storeFile file('mykeystore.jks')
        keyPassword('key')
        storePassword('store')
    }
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfigs signingConfigs.release
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
compile "com.android.support:appcompat-v7:$support_version"
compile "com.android.support:support-v4:$support_version"
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile "io.reactivex:rxjava:1.0.14"
compile('io.reactivex:rxkotlin:0.24.100') { exclude module: 'funktionale' }
compile "io.reactivex:rxandroid:1.0.1"
compile "com.jakewharton.rxbinding:rxbinding-kotlin:0.3.0"
compile 'org.jetbrains.kotlin:kotlin-reflect:1.0.0-beta-1038'

compile 'com.trello:rxlifecycle:0.3.0'
compile 'com.trello:rxlifecycle-components:0.3.0'

compile 'com.parse:parse-android:1.10.2'
}

Properties props = new Properties()
props.load(project.rootProject.file('local.properties').newDataInputStream())
String parseAppId = props.getProperty('parse.app_id') ?: "Specify APP_ID"
String parseClientKey = props.getProperty('parse.client_key') ?: "Specify CLIENT_KEY"

android.buildTypes.each { type ->
type.buildConfigField 'String', 'PARSE_APP_ID', "\"$parseAppId\""
type.buildConfigField 'String', 'PARSE_CLIENT_KEY', "\"$parseClientKey\""
}

I use gradle plugin 1.4.0-beta6.

And here's my error log:

Error:(30, 0) Gradle DSL method not found: 'signingConfigs()' Possible causes:

  • The project 'TestProject' may be using a version of Gradle that does not contain the method. Open Gradle wrapper file
  • The build file may be missing a Gradle plugin. Apply Gradle plugin
  • Stanislav
    • 27,441
    • 9
    • 87
    • 82
    Maxim Blumental
    • 763
    • 5
    • 26

    1 Answers1

    0

    Rename a property in your release buildType from signingConfigs to signingConfig as:

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

    Take a look at the dsl reference, you've misspelled the property name.

    Stanislav
    • 27,441
    • 9
    • 87
    • 82