错误:(18,0)摇篮DSL方法未找到:'机器人() [英] Error:(18, 0) Gradle DSL method not found: 'android()'

查看:203
本文介绍了错误:(18,0)摇篮DSL方法未找到:'机器人()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有问题:

错误:(19,0)摇篮DSL方法未找到:'机器人()

Error:(19, 0) Gradle DSL method not found: 'android()'

-The项目X可能使用一个版本的gradle泰德并不contais方法

-The project 'x' may be using a version of gradle thet does not contais the method

打开包装的gradle文件

Open gradle wrapper file

-The建立文件可能丢失的Gradle一个插件

-The build file may be missing a gradle plugin

应用插件的gradle

Apply gradle plugin

的build.gradle:

build.gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
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()
    }
}
android {
}
dependencies {
}

app.gradle:

app.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "23.0.0 rc3"

    compileOptions {
        encoding "UTF-8"
    }

    defaultConfig {
        applicationId "es.albertoramos.pfcalbertoramos"
        minSdkVersion 15
        targetSdkVersion 22
        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 'com.android.support:appcompat-v7:22.2.1'
}

如何解决这个问题?

How fix this problem?

推荐答案

这的build.gradle删除此

Delete this from build.gradle

android {
}
dependencies {
}

这篇关于错误:(18,0)摇篮DSL方法未找到:'机器人()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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