首先,我已经阅读了所有其他的解决方案帖子和关于迁移到1.0的官方文档。到目前为止,没有一个是有效的。
错误:
Error:(23, 0) Gradle DSL method not found: 'classpath()'
Possible causes:<ul><li>The project 'SparkDatabase' may be using a version of Gradle that does not contain the method.
<a href="open.wrapper.file">Open Gradle wrapper file</a></li><li>The build file may be missing a Gradle plugin.应用Gradle插件
目前,这是我的build.gradle:
应用插件:'com.android.application‘
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "ca.industrycorp.sparkdatabase"
minSdkVersion 19
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'de.greenrobot:greendao:1.3.7'
compile 'de.greenrobot:greendao-generator:1.3.1'
compile files('libs/json-simple-1.1.1.jar')
compile files('libs/java-json.jar')
}我的另一个gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}或者:我如何做一个全新的Android Studio 1.0安装,它可以简单地开箱即用,而不必与我以前使用的0.9相关?
发布于 2016-03-24 16:23:18
通过将类路径放在顶级build.gradle中,它为我解决了这个问题。
发布于 2015-11-17 08:05:20
有2个build.gradle文件。当我在第一个文件(具有所有已编译依赖项的文件)中添加类路径时,我发现了这个错误。另一个已经有了一些类路径行(或者随便你怎么叫它们)。
https://stackoverflow.com/questions/28614898
复制相似问题