我刚刚将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')
}
答案 0 :(得分:0)
更新到最新的Android Studio版本2.1.1
后,不会出现此gradle构建错误