android - 找不到方法'org.gradle.api.tasks.compile.CompileOptions

标签 android android-studio gradle dependencies

我什么都没改变。
请有人帮我解决这个问题:

ERROR: Unable to find method 'org.gradle.api.tasks.compile.CompileOptions.setBootClasspath(Ljava/lang/String;)V'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

最佳答案

应用程式(build.gradle)

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

buildscript {
    repositories {
        jcenter()
        mavenCentral()
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files

        classpath 'com.google.gms:google-services:3.1.2'
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'

        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
    }
}

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

    // source :
    // https://stackoverflow.com/questions/34828426/disable-javadoc-check-for-bintray-upload
    tasks.withType(Javadoc) {
        options.addStringOption('Xdoclint:none', '-quiet')
        options.addStringOption('encoding', 'UTF-8')
    }
}

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

关于android - 找不到方法'org.gradle.api.tasks.compile.CompileOptions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58954533/

相关文章:

android - 我可以在 Scala 中编写一些代码(使用 Android Studio)吗?

java - 如何访问android中的特定内部存储目录?

java - 匿名类中的 Activity 名称是什么

java - 使用 Gradle 将 Artifact 发布到 s3 上的远程 Maven 存储库

java - 创建类路径资源中定义的名称为 'sessionRepositoryFilterRegistration' 的 bean 时出错

android - 如何仅从元素的一侧删除边框?

android - 如何设置在 ListPreference 中选中的值

android - 从 vlc 到 android 的视频流,视频丢失

java - Android:在JDK 10上为1.8目标构建Java代码时出现Gradle错误(gradle build-> NullPointerException)

java - 如何更改为我可以删除的 ValueEventListener?