Android studio &引用;错误:原因:org.gradle.model.internal.report.unbound.UnboundRule“;使用实验梯度0.6.0时

Android studio &引用;错误:原因:org.gradle.model.internal.report.unbound.UnboundRule“;使用实验梯度0.6.0时,android-studio,gradle-experimental,Android Studio,Gradle Experimental,遵循本文,使用AndroidStudio调试我的项目 使用以下渐变配置,将列出错误“error:Cause:org.gradle.model.internal.report.unbound.UnboundRule” build.gradle: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle-ex

遵循本文,使用AndroidStudio调试我的项目

使用以下渐变配置,将列出错误“error:Cause:org.gradle.model.internal.report.unbound.UnboundRule”

build.gradle:

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

allprojects {
    repositories {
        jcenter()
    }
}
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'
}
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:

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

allprojects {
    repositories {
        jcenter()
    }
}
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'
}
“注意:android.signingConfigs当前必须在android{}块之外。”

将signingConfigs{}块移出android{}块,错误已修复。

“注意:android.signingConfigs当前必须在android{}块之外。”


将signingConfigs{}块移出android{}块,错误已修复

这已修复我的问题。我也有同样的情况。谢谢这已经解决了我的问题。我也有同样的情况。谢谢