0

following this article http://tools.android.com/tech-docs/new-build-system/gradle-experimental to make my project debugged with AndroidStudio

with following gradle config, error "Error:Cause: org.gradle.model.internal.report.unbound.UnboundRule" is listed

build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle-experimental:0.6.0-beta5'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

gradle/wrapper/gradle-wrapper.properties

#Wed Oct 21 11:34:03 PDT 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

app/build.gradle:

apply plugin: 'com.android.model.application'

model {
    android {
        compileSdkVersion = 23
        buildToolsVersion = "23.0.2"

        useLibrary 'org.apache.http.legacy'

        ndk {
            moduleName = "nativemodule"
        }

        defaultConfig.with {
            applicationId = "package.name"
            minSdkVersion.apiLevel = 10
            targetSdkVersion.apiLevel = 23

            multiDexEnabled = true
        }

        lintOptions {
            checkReleaseBuilds = false
            abortOnError = false
        }

        dexOptions {
            incremental = false
            javaMaxHeapSize = "2048M"
        }

        signingConfigs {
            create("debug") {
                storeFile 'myapp.keystore'
                storePassword "xxx"
                keyAlias "xxx"
                keyPassword "xxx"
                storeType "jks"
            }
            create("release") {
                storeFile 'myapp.keystore'
                storePassword "xxx"
                keyAlias "xxx"
                keyPassword "xxx"
                storeType "jks"
            }
        }

        buildTypes {
            debug {
                minifyEnabled = false
                zipAlignEnabled = false
                shrinkResources = false
                signingConfig = $("android.signingConfigs.debug")
                ndk {
                    debuggable = true
                }
            }
            release {
                minifyEnabled = true
                zipAlignEnabled = true
                shrinkResources = true
                signingConfig = $("android.signingConfigs.release")
                ndk {
                    debuggable = false
                }
                proguardFiles.add(file('proguard.cfg'))
            }
        }
    }
}

dependencies {
    compile 'com.android.support:multidex:1.0.0'
}
RoFF
  • 529
  • 5
  • 27

1 Answers1

2

"NOTE: android.signingConfigs currently must be outside of the android {} block."

move signingConfigs {} block out of android {} block, the error fixed

RoFF
  • 529
  • 5
  • 27