Android studio 构建脚本错误,发现不支持的 gradle DSL 方法:android()! [英] Android studio build script error,unsupported gradle DSL method found : android()!

查看:36
本文介绍了Android studio 构建脚本错误,发现不支持的 gradle DSL 方法:android()!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我把Android Studio升级到AS 0.6然后导入AS 0.3开发的项目

I upgraded the Android Studio to AS 0.6 then imported the project developed in AS 0.3

我收到如下错误:

Build script error,unsupported Gradle DSL method found : android()'!,

Possible causes could be:  

 - you are using Gradle version where the method is absent 
    ("open_gradle_settings">Fix Gradle settings</a>)

 - you didn't apply Gradle plugin which provides the method 
    (<a href="apply_gradle_plugin">Apply Gradle plugin</a>)

or there is a mistake in a build script (<a href="goto_source">Goto source</a>)

我将 build.gradle 中的依赖路径更改为:

I changed my dependencies path in build.gradle to:

dependencies {
    classpath 'com.android.tools.build:gradle:0.11.+'
}

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 14
}

可能是什么问题?

是否有任何指南告诉如何升级项目?

Is there any guide which tells how to upgrade the project?

推荐答案

其实是在错误信息里说的.所以只需添加

Actually it stated in the error message. So just add

apply plugin: 'com.android.application'

dependencies 部分和android 部分之间

这篇关于Android studio 构建脚本错误,发现不支持的 gradle DSL 方法:android()!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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