Android Studio 3.0-无法找到方法'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List' [英] Android Studio 3.0 - Unable to find method 'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List'

查看:506
本文介绍了Android Studio 3.0-无法找到方法'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用Android Studio 3.0 Canary 1启动新的Kotlin项目会显示此错误.完整跟踪:

Trying to start a new Kotlin project with Android Studio 3.0 Canary 1 displays this error. Full trace:

错误:无法找到方法 'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List;'. 导致此意外错误的可能原因包括:

  • 成绩等级 依赖项缓存可能已损坏(这有时会在网络之后发生 连接超时.)重新下载依赖项 并同步项目(需要网络)
  • Gradle的状态 构建过程(守护程序)可能已损坏.停止所有Gradle守护程序可能 解决这个问题.停止Gradle构建 进程(需要重新启动)
  • 您的项目可能正在使用 与第三方插件不兼容的第三方插件 要求的项目或Gradle版本 项目.

Error:Unable to find method 'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List;'. 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.

我尝试了前两个选项,并且第三方插件保留为默认设置.

I've tried the first two options and the third-party plugins are left as default.

gradle-wrapper.properties

#Thu May 18 08:36:52 BST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip

build.gradle

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

buildscript {
    ext.kotlin_version = '1.1.2-3'
    repositories {
        maven { url 'https://maven.google.com' }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

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

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

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

我自己没有触摸任何这些值,它们保留为默认值.创建非科特林的新项目不会出现此问题.

I haven't touched any of these values myself, they're left as default. Creating a non-Kotlin new project does not have this problem.

推荐答案

在我的 build.gradle 更改中

ext.kotlin_version = '1.1.2-3'

ext.kotlin_version = '1.1.2-4'

解决了这个问题.

您可以在此处找到最新版本.

You can find the most recent version here.

这篇关于Android Studio 3.0-无法找到方法'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆