【问题标题】:Android studio 23.0.0 rc3 error | tried all solutions not workngAndroid studio 23.0.0 rc 3 错误 |尝试了所有解决方案都不起作用
【发布时间】:2015-10-04 17:37:08
【问题描述】:

我已经搜索并尝试了所有 stackover flow 方法,但都没有帮助。

我明白了

// 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.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

当我尝试添加 (22 lolipop) 和 23.0.1 时,它显示 open gradle wrapper fileapply plugin 没有任何效果

Error:(19, 0) Gradle DSL method not found: 'android()'
Possible causes:<ul><li>The project 'booook' 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.
<a href="apply.gradle.plugin">Apply Gradle plugin</a></li>


// 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.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
allprojects {
    repositories {
        jcenter()
    }
}

android {
    compileSdkVersion 22
    buildToolsVersion '23.0.1'
}
dependencies {
}


这就是我在进行更改后得到的最终结果
http://s9.postimg.org/fzg0sie8v/image.png
http://s30.postimg.org/6eepfqxtd/image.png
http://s11.postimg.org/b6l12ec8z/image.png
http://s11.postimg.org/b6l12ec8z/image.png

【问题讨论】:

    标签: android android-studio gradle android-gradle-plugin build.gradle


    【解决方案1】:

    您位于顶层构建文件(文件的第一行)
    你应该在你的子项目中添加这个新内容(通常是 app/build.gradle)

    【讨论】:

      【解决方案2】:

      从您的顶级 build.gradle 中删除这些行

      android {
          compileSdkVersion 22
          buildToolsVersion '23.0.1'
      }
      dependencies {
      }
      

      这是原因

      错误:(19, 0) Gradle DSL 方法未找到:'android()'

      【讨论】:

        猜你喜欢
        • 2022-07-14
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-02-24
        • 1970-01-01
        相关资源
        最近更新 更多