kolibreath
kolibreath

Reputation: 125

Unable to find method 'com.android.build.gradle.api.BaseVariant.getOutputs()Ljava/util/List;'after upgrading Android Studio to 3.0

This is an project my friend and I developed when I was using Android Studio 2.3.1. After upgrading to Android Studio 3.0 . This error occurred:

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.

I read a lot of errors and their solutions here , and I noticed event I changed ext.kotlin_version = '1.1.2-4' doesn't help

here are the gradle scripts:

buildscript {
ext.kotlin_version = '1.1.2-4'
repositories {
    jcenter()
    maven { url 'https://maven.google.com' }
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
    classpath 'com.jakewharton:butterknife-gradle-plugin:8.7.0'
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
    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
    classpath 'com.jakewharton:butterknife-gradle-plugin:8.8.1'
}
}

allprojects {
repositories {
    jcenter()
    maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir}

apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
    applicationId "com.joinme"
    minSdkVersion 15
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 
'proguard-rules.pro'
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'

compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.2.0'

compile 'com.android.support:appcompat-v7:26.+'
compile 'com.google.android.gms:play-services-vision:8.1.0'
compile 'com.android.support:design:23.0.0'

compile 'io.reactivex:rxjava:1.0.14'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'com.squareup.retrofit2:adapter-rxjava:2.0.2'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.okhttp3:okhttp:3.4.1'

compile 'com.jakewharton:butterknife:8.7.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'

compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.android.support:recyclerview-v7:21.0.0'


compile 'me.itangqi.waveloadingview:library:0.3.5'

testCompile 'junit:junit:4.12'

}

Upvotes: 1

Views: 721

Answers (1)

Sharath kumar
Sharath kumar

Reputation: 4132

Remove plugin apply plugin: 'com.jakewharton.butterknife' in android 3.0

Instead use this

compile 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'

Upvotes: 3

Related Questions