简体   繁体   English

在根项目上找不到参数android()的方法…

[英]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.

相关问题 在根项目 Android Studio 上找不到 arguments [:app] 的方法 include() - Could not find method include() for arguments [:app] on root project Android Studio 在类型为org.gradle.api.Project的根项目&#39;..&#39;上找不到参数[build ..]的方法android() - Could not find method android() for arguments [build..] on root project '..' of type org.gradle.api.Project 在多模块项目的根目录中找不到方法android() - Could not find method android() in root of multimodule project Gradle 同步失败:在 android studio 上找不到根项目参数的方法 android() - Gradle sync failed: Could not find method android() for arguments on root project on android studio Android studio错误:错误:(23,0)无法在根项目上找到方法android() - Android studio error:Error:(23, 0) Could not find method android() for arguments on root project 在根项目上找不到参数[:app]的方法include() - Could not find method include() for arguments [:app] on root project 构建 gradle:找不到参数根项目“fasterDev”的方法 PackagingOptions() - Build gradle : Could not find method packagingOptions() for arguments root Project "fasterDev" 在 org.gradle.api.Project 类型的根项目“xyz”上找不到 arguments [before_plugins_] 的方法 android() - Could not find method android() for arguments [before_plugins_] on root project 'xyz' of type org.gradle.api.Project 错误:(16,0)找不到类型为org.gradle.api.Project的根项目&#39;delta-bartalk&#39;上的参数的方法android() - Error:(16, 0) Could not find method android() for arguments on root project 'delta-bartalk' of type org.gradle.api.Project 在根项目上找不到参数[build…]的方法android(),也无法构建gradle项目,也找不到调试密钥库 - Could not find method android () for arguments [build…] on root project, also can't build gradle projects and can't find the debug keystore
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM