Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android kotlin project build stuck on app:kaptDebugKotlin task

I have next issue during the project building process: build process just stuck on app:kaptDebugKotlin task. 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 the app build.gradle itself:

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 plugin versions but it didn't help. As for using Room seems it's not a problem because this example builds without problems. Will be very appreciate for any help.

like image 856
Rodion Surzhenko Avatar asked May 19 '17 16:05

Rodion Surzhenko


1 Answers

Is this still an issue? The same problem for me was resolved by just using the newest kotlin - 1.3.60.

like image 150
Mugurel Avatar answered Oct 15 '22 00:10

Mugurel