我收到以下错误:没有发现过Android Studio摇篮DSL方法:“编译()”
Error:(4, 0) Gradle DSL method not found: 'compile()'
Possible causes:The project 'Jp' may be using a version of Gradle that does not contain the method.
Open Gradle wrapper file.The build file may be missing a Gradle plugin.
我试图寻找其他类似的问题,但毫无效果。 我的build.gradle(项目:JP)文件是如下:
错误:(4,0)摇篮DSL方法未找到: '编译()'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
的build.gradle(模块:应用)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.jal.jp"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(":sdk-audio-1.60.1")
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
}
的build.gradle(SDK音频-1.60.1)
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.example.jal.jp"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(":sdk-audio-1.60.1")
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
}
settings.gradle:
include ':app', ':sdk-audio-1.60.1'
任何人都可以帮我解决这个问题吗?
感谢
错误:(1 ,0)支持的最小Gradle版本是3.3。当前版本是2.8。如果使用gradle包装,请尝试编辑C:\ Users \ Jal \ Jp \ gradle \ wrapper \ gradle-wrapper.properties中的distributionUrl到gradle-3.3-all.zip 我照你所说做过,但是我得到了这个错误。你能帮忙吗? –
这意味着你应该升级gradle。尝试将** C:\ Users \ Jal \ Jp \ gradle \ wrapper \ gradle-wrapper.properties **中的行更改为'distributionUrl = https \://services.gradle.org/distributions/gradle-3.3-all。 zip'在 –
我做到了..它永远建设..感谢很多尽管..赞赏它。 –