Android 未找到Gradle DSL方法:';applicationId()';
我在Android Studio中构建应用程序时遇到此错误Android 未找到Gradle DSL方法:';applicationId()';,android,build,android-gradle-plugin,Android,Build,Android Gradle Plugin,我在Android Studio中构建应用程序时遇到此错误 Gradle DSL method not found: 'applicationId()' build.gradle: apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.2" applicationId "com.ms.knowursensor.android
Gradle DSL method not found: 'applicationId()'
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
applicationId "com.ms.knowursensor.android"
minSdkVersion 13
defaultConfig {
targetSdkVersion 23
versionCode 1
versionName "1.0"
ndk {
moduleName "sensorgraph"
stl "c++_static"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk {
debuggable = true
}
}
debug {
debuggable true
jniDebuggable true
}
}
sourceSets {
main {
jniLibs.srcDir 'src/main/jniLibs'
// use the jni .so compiled from the manual ndk-build command
jni.srcDirs = [] //disable automatic ndk-build
}
}
}
repositories {
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:support-v4:23.1.1'
}
这个问题是在我最近更新SDK时出现的。如何解决此问题?将
applicationId
和minSdkVersion
移动到您的defaultConfig
闭包中