android - 项目在编译时,Gradle出现了一些错误,没有遇到类似的问题

标签 android gradle android-gradle-plugin

我的项目在运行时,出现了gradle版本的错误,我尝试了很多方法都无法解决,我们还没有遇到类似的错误,以下是错误日志。

Error:(1, 0) Gradle DSL method not found: 'apply()' Possible causes:The project 'xindatx1.6.0' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0). Fix plugin version and sync projectThe project 'xindatx1.6.0' may be using a version of Gradle that does not contain the method. Open Gradle wrapper fileThe build file may be missing a Gradle plugin. Apply Gradle plugin

最佳答案

    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

    repositories {
        google()
        maven {
            url "https://maven.google.com"
        }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
       classpath 'com.novoda:bintray-release:0.8.1'
        classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

}

allprojects {
    repositories {
        google()
        maven { url "https://jitpack.io" }
        jcenter()
        mavenCentral()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

关于android - 项目在编译时,Gradle出现了一些错误,没有遇到类似的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37771102/

相关文章:

scala - 使用 -feature 重新运行以获取详细信息,如何在使用 gradle 构建时查看 scala 功能警告?

android - Android Gradle奇怪的错误

android-studio - 如何强制停止在 Android Studio 中运行的 Gradle Build

java - 更新按钮颜色

android - 预加载 progressDialog 使我的应用程序仅在 ICS 中崩溃

android - 使用 Itemtouchhelper 更改房间数据库的顺序

android - 在多个应用程序模块中重复使用 proguard-rules.pro 文件

java - 使用 Gradle 构建时出错 : Cause: error=2, 没有这样的文件或目录

android - java.util.zip.ZipException Android Studio

android - 在我失去连接之前,有没有办法通过蓝牙发送命令