Error:(10, 0) gradle method not found classpath()
Error:(10, 0) gradle method not found classpath()
你好,我是 Android studio 的新手,我将 facebook 导入为,首先我得到了这个错误 Error:(111) Cannot call getBootClasspath() before setTargetInfo() is called.
,然后我按照正确的答案 。即我从
更改了我的依赖项
dependencies {
compile 'com.android.support:support-v4:[21,22)'
compile 'com.parse.bolts:bolts-android:1.1.4'
}
到
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
现在我收到了这个错误
Error:(10, 0) Gradle DSL method not found: 'classpath()'
Possible causes:The project 'FiberTeccpcp' may be using a version of Gradle that does not contain the method.
Gradle settings
The build file may be missing a Gradle plugin.
Apply Gradle plugin
最后这是我的 build.gradle 文件
apply plugin: 'com.android.library'
repositories {
mavenCentral()
}
project.group = 'com.facebook.android'
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
}
lintOptions {
abortOnError false
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
apply plugin: 'maven'
apply plugin: 'signing'
......
我该如何纠正?
您必须将此部分包含在 buildscript
块中
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
应该是:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
}
你好,我是 Android studio 的新手,我将 facebook 导入为,首先我得到了这个错误 Error:(111) Cannot call getBootClasspath() before setTargetInfo() is called.
,然后我按照正确的答案
dependencies {
compile 'com.android.support:support-v4:[21,22)'
compile 'com.parse.bolts:bolts-android:1.1.4'
}
到
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
现在我收到了这个错误
Error:(10, 0) Gradle DSL method not found: 'classpath()'
Possible causes:The project 'FiberTeccpcp' may be using a version of Gradle that does not contain the method.
Gradle settings
The build file may be missing a Gradle plugin.
Apply Gradle plugin
最后这是我的 build.gradle 文件
apply plugin: 'com.android.library'
repositories {
mavenCentral()
}
project.group = 'com.facebook.android'
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 8
targetSdkVersion 21
}
lintOptions {
abortOnError false
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
}
}
}
apply plugin: 'maven'
apply plugin: 'signing'
......
我该如何纠正?
您必须将此部分包含在 buildscript
块中
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
应该是:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.3'
}
}