Error upgrading to Kotlin 1.2.60, Android Studio 3.1.3

Refresh

April 2019

Views

330 time

1

Pretext: I have 3 build variants for my project apart from release and debug I also have the staging variant.

Gradle sync works completely fine with version 1.2.51, but as soon as I upgrade to version 1.2.60, which released recently, gradle sync fails with the following error message:

Could not find method kapt() for arguments [[email protected]] on object of type com.android.build.gradle.LibraryExtension.

Any help/ insight on this would be really great, I tried searching for a while, but was stuck on what to search exactly, what I think could be the issue here is the kapt plugin as the changelog mentions changes in it, chec this, but couldn't get it running.

Dependecies:

Top level gradle:

dependencies {
        classpath 'com.android.tools.build:gradle:3.3.0-alpha03'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "io.realm:realm-gradle-plugin:$realm_version"
        classpath 'com.akaita.android:easylauncher:1.2.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.0.1'
        classpath 'io.fabric.tools:gradle:1.25.4'
        classpath 'com.google.firebase:firebase-plugins:1.1.5'
    }

App level:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'

apply plugin: 'realm-android'
apply plugin: 'io.fabric'
apply plugin: 'com.google.firebase.firebase-perf'

PS: I'm on Gradle plugin 4.9, Studio 3.1.3 and android gradle plugin 3.3.0-alpha03.

Thank you.

1 answers

3

I found the solution to this, in case anyone struggles with it,

The problem:

I had a module dependency, which was using some kapt methods but hadn't included

apply plugin: 'kotlin-kapt' in it's project level build.gradle file.

I added it and voila, it works.