360SDN.COM

如何在Android Studio解决Could not find method android() for arguments问题

来源:  2017-06-17 19:00:20    评论:0点击:

来源:http://blog.csdn.net/xiaoshitou_2015/article/details/61616479
 在导入新项目的时候,发现一直有个bug存在,编译出现如下错误:
Error:(23, 0) Could not find method android() for arguments [****] on root project '****' of type org.gradle.api.Project.
最终解决方案:打开项目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:2.2.2'
        classpath 'com.novoda:bintray-release:0.3.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}
android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'
}
dependencies {
}

将其中的

android {
    compileSdkVersion 23
    buildToolsVersion '23.0.3'
}

删除或注释掉后重新编译通过。
为您推荐

友情链接 |九搜汽车网 |手机ok生活信息网|ok生活信息网|ok微生活
 Powered by www.360SDN.COM   京ICP备11022651号-4 © 2012-2016 版权