[英]Could not find method android() for arguments … on root project
I've been trying to import a project to Android Studio and this is where I am stuck, there is a similar question on Stack Overflow but it did not provide a solution to my particular error sadly... 我一直在尝试将项目导入Android Studio,这就是我遇到的问题,Stack Overflow也有类似的问题,但遗憾的是它没有提供解决我特定错误的方法...
This is my error log: 这是我的错误日志:
Error:(24, 0) Could not find method android() for arguments [build_*********$_run_closure3@****] on root project 'project_name' of type org.gradle.api.Project.
Here is my file Gradle: 这是我的文件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.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
}
dependencies {
}
If you can help me, thank you <3 如果可以帮助我,谢谢<3
Move this from the project build.gradle
file to the module build.gradle
file (eg, app/build.gradle
): 将其从项目
build.gradle
文件移动到模块build.gradle
文件(例如, app/build.gradle
):
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
}
dependencies {
}
android {
compileSdkVersion 25
buildToolsVersion '25.0.0'
}
dependencies {
}
These belong to (Module:app) level of build.gradle 这些属于build.gradle的(Module:app)级别
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.