我重新安装了 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.
打开文件
我在互联网上找到的解决方案包括更改代码..所以它们与我无关
谢谢!! 构建.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
文件。
在这个文件中你不能使用这个 block :
android {
buildToolsVersion '24.0.1'
}
删除此 block 。
关于java - Android Studio 错误 :Error:(23, 0) 找不到根项目参数的方法 android(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39046363/