gpt4 book ai didi

安卓工作室 : Gradle DSL method not found: 'classpath()'

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:47:21 27 4
gpt4 key购买 nike

首先,我阅读了所有其他解决方案帖子和关于迁移到 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 相关?

最佳答案

通过将类路径放在顶级 build.gradle 中,它为我解决了这个问题。

关于安卓工作室 : Gradle DSL method not found: 'classpath()' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28614898/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com