与Gradle同步项目' HelloWorld'失败:执行模型规则时抛出异常:NdkComponentModelPlugin.Rules #createNativeBuildModel

时间:2016-04-24 19:30:36

标签: android-studio android-gradle android-studio-2.0

我刚刚将Android Studio升级到2.0版,并收到以下错误消息

  

与Gradle同步项目' HelloWorld'失败:执行模型规则时抛出异常:NdkComponentModelPlugin.Rules#createNativeBuildModel

构建文件看起来像

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

model {

    android {
        compileSdkVersion = 15
        buildToolsVersion = "23.0.2"

        defaultConfig.with {
            applicationId = "com.test.helloworld"
            minSdkVersion.apiLevel = 15
            targetSdkVersion.apiLevel = 15
        }
    }

    android.sources {
        main {
            jniLibs {
                source {
                    srcDirs "libs"
                }
            }
        }
    }

    android.buildTypes {
        release {
            minifyEnabled = true
            proguardFiles.add(file('proguard-rules.txt'))
        }
        debug {
            minifyEnabled = false
            ndk.with {
                debuggable = true
            }
        }
    }
}

    dependencies {
        compile files('libs/xxx.jar')
        compile files('libs/xxx1.jar')
    }

1 个答案:

答案 0 :(得分:0)

更新到最新的Android Studio版本2.1.1

后,不会出现此gradle构建错误