Android的工作室:摇篮DSL方法未找到:'classpath中() [英] Android Studio: Gradle DSL method not found: 'classpath()'

查看:338
本文介绍了Android的工作室:摇篮DSL方法未找到:'classpath中()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我读过的所有其他解决方案职位和迁移到1.0的官方文档。到目前为止,还没有工作过。

First of all, I've read all other solution posts and the official documentation on migrating to 1.0. So far, none has worked.

错误:

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.

应用摇篮插件

目前,这是我的build.gradle:

Currently, this is my build.gradle:

应用插件:'com.android.application

apply plugin: '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其他:

My other 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工作室1.0的全新安装,将只是工作开箱即用,无需涉及到0.9,我收到了怎么​​办

Alternatively: How do I make a fresh installation of Android Studio 1.0 that would simply work out of the box, without having to relate to the 0.9 that I had before?

推荐答案

有2的build.gradle文件。我发现这个错误,当我在第一个(这已经符合所有依赖文件)添加类路径中。另一位已经有了一些类路径线(或任何你给他们打电话)。

There are 2 build.gradle files. I found this error when I was adding classpath in the first one(The file that had all complied dependencies). The other one already had some classpath lines(or whatever you call them).

这篇关于Android的工作室:摇篮DSL方法未找到:'classpath中()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆