尝试使用Android Studio 3.0 Canary 1启动一个新的Kotlin项目时显示此错误。完整跟踪:
'com.android.build.gradle.internal.variant.BaseVariantData.getOutputs()Ljava/util/List;'.错误:找不到方法
此意外错误的可能原因包括:
在Gradle进程损坏的情况下,您还可以尝试关闭IDE,然后杀死所有Java进程。
我已经尝试了前两个选项,第三方插件保留为默认。
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
}
我自己还没有接触到这些值中的任何一个,它们被保留为默认值。创建一个非Kotlin的新项目没有这个问题。
发布于 2017-05-18 17:00:56
在my build.gradle changing中
ext.kotlin_version = '1.1.2-3'
至
ext.kotlin_version = '1.1.2-4'
已修复此问题。
您可以找到最新版本的here。
发布于 2017-09-14 23:27:33
这对我很管用
使用8.4.0版本
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
发布于 2017-11-07 15:43:37
用于Java的
只需移除
classpath 'me.tatarka:gradle-retrolambda:3.7.0'
将butterknife
版本降级到8.4.0
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
别忘了删除
apply plugin: 'me.tatarka.retrolambda'
从应用程序级别构建gradle。
https://stackoverflow.com/questions/44042754
复制相似问题