user6412545
user6412545

Reputation: 83

com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'

Error:Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'. Possible causes for this unexpected error include:

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

In Android studio 3.0 on this problem, use the JakeWharton great god butterknife. Please how to deal with this problem, this is no problem on the Android studio 2.3. May be I used the wrong way, please advise, is originally used 8.5.1 version, an error, I upgraded to 8.6.0, found that the problem cannot be solved.

  buildscript {
        repositories {
            jcenter()
            mavenCentral()
            maven {
                url "https://jitpack.io"
            }
            maven {
                url 'https://maven.google.com'
            }
            maven {
                url 'https://dl.google.com/dl/android/maven2/'
            }
        }

        dependencies {
            classpath 'com.android.tools.build:gradle:3.0.0-alpha4' 
            classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
            classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1+'
            classpath 'com.jakewharton:butterknife-gradle-plugin:8.6.0' 
            classpath ("com.tencent.mm:AndResGuard-gradle-plugin:1.2.3") { changing=true } 
           classpath 'com.letv.sarrsdesktop:BlockCanaryExPlugin:0.9.8.3'
        }
    }

    allprojects {
        repositories {
            jcenter()
            mavenCentral()
            maven {
                url "https://jitpack.io"
            }
            maven {
                url 'http://www.idescout.com/maven/repo/'
            }
            maven {
                url "http://repo.baichuan-android.taobao.com/content/groups/BaichuanRepositories"
            }
            maven {
                url 'https://maven.google.com'
            }
            maven {
                url 'https://dl.google.com/dl/android/maven2/'
            }
        }

    }


    configurations {
        all*.exclude group: 'com.android.support', module: 'support-v4'
    }

    task printProps << {
        println commandLineProjectProp
        println gradlePropertiesProp
        println systemProjectProp
        println envProjectProp
        println System.properties['system']
    }






apply plugin: 'com.android.application'
//butterknife
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'com.jakewharton.butterknife'


/**
 * library
 */
dependencies {
      compile 'com.jakewharton:butterknife:8.6.0+'
      apt 'com.jakewharton:butterknife-compiler:8.6.0+'
}

Upvotes: 6

Views: 2212

Answers (3)

norbDEV
norbDEV

Reputation: 5365

  • Kotlin 1.2.10
  • Gradle 3.0.1
  • Build tools version 27.0.3
  • apply plugin: 'com.android.library'
  • apply plugin: 'kotlin-android-extensions'
  • apply plugin: 'kotlin-android'
  • apply plugin: 'com.jakewharton.butterknife'

In my library project this comment helped me (R2 imports): https://github.com/JakeWharton/butterknife/issues/963#issuecomment-342547601

project's build.gradle:

buildscript {
    repositories {
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.jakewharton:butterknife-gradle-plugin:9.0.0-SNAPSHOT'
    }
}

repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

module's build.gradle:

apply plugin: 'com.jakewharton.butterknife'

...

dependencies {
    compile 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
    kapt 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'
}

This way you can use the

apply plugin: 'com.jakewharton.butterknife'

Upvotes: 2

Aks4125
Aks4125

Reputation: 5720

Just remove

classpath 'me.tatarka:gradle-retrolambda:3.7.0'

downgrade butterknifeversion to 8.4.0

classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'

Don't forget to remove below line

apply plugin: 'me.tatarka.retrolambda'

Upvotes: 2

eyeeaaaa
eyeeaaaa

Reputation: 93

Downgrade butterknife-gradle-plugin to 8.4 or use 9.0 snapshot.

Upvotes: 5

Related Questions