【发布时间】:2016-12-27 01:07:39
【问题描述】:
我重新安装了 android studio,我在另一台 PC 上使用与 android studio 相同的项目,所以代码可能没问题! 这是完整的错误:
Error:(23, 0) Could not find method android() for arguments [build_1z9k6ruj47plglocgqknjnoag$_run_closure3@133cf914] on root project 'allthingsvegan-android-9d296805dc64' of type org.gradle.api.Project.
打开文件
我在互联网上找到的解决方案包括更改代码。所以它们与我无关
谢谢!! 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:2.2.0-beta1'
classpath 'com.google.gms:google-services:3.0.0'
// 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 {
buildToolsVersion '24.0.1'
}
【问题讨论】:
-
尝试清理项目
-
显示你的 build.gradle
-
我已经用 build.gradle 编辑了原帖
-
尝试清理项目没有成功(与此处提到的问题相同)
-
@ligi 忘了通知你
标签: java android android-studio android-gradle-plugin build.gradle