Android kotlin project build stuck in application: kaptDebugKotlin task

I have the following problem during the project build process: the build process just got stuck in the task app:kaptDebugKotlin. My root project build.gradle:

apply plugin: "kotlin"
buildscript {
    ext.kotlin_version = '1.1.2-2'
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.2'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"            
    }
}

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

ext {
    buildToolsVersion = '25.0.2'
    supportLibVersion = '25.3.1'
    runnerVersion = '0.5'
    rulesVersion = '0.5'
    espressoVersion = '2.2.2'
    archLifecycleVersion = '1.0.0-alpha1'
    archRoomVersion = '1.0.0-alpha1'
}

and application build.gradle:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 25
    buildToolsVersion rootProject.ext.buildToolsVersion
    defaultConfig {
        applicationId "com.test.roomtest"
        minSdkVersion 14
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.android.support:appcompat-v7:25.3.1'

    compile "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
    compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"

    compile 'io.reactivex.rxjava2:rxjava:2.1.0'
    compile "io.reactivex.rxjava2:rxandroid:2.0.1"
    compile "android.arch.persistence.room:runtime:${rootProject.archRoomVersion}"
    compile "android.arch.persistence.room:rxjava2:${rootProject.archRoomVersion}"
    kapt "android.arch.persistence.room:compiler:${rootProject.archRoomVersion}"
}
repositories {
    mavenCentral()
}

I tried to use different versions of the plugins, but this did not help. As for use Room, this is not a problem, because this example builds without problems. We will be very grateful for any help.

+4
source share

Source: https://habr.com/ru/post/1677554/


All Articles