I'm new to using Kotlin and trying to set it up with Dagger2, I've seen some few examples but none of them seem to work for me.
I keep getting this
Error:Execution failed for task ':app:kaptDebugKotlin'.
Internal compiler error. See log for more details
I have my build.gradle (Module: app)
apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-android-extensions' android { compileSdkVersion 25 buildToolsVersion "25.0.0" defaultConfig { applicationId "com.exampleapp" 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' } } kapt { generateStubs = true } dexOptions { javaMaxHeapSize "2048M" } } ext { supportLibVer = '25.0.0' daggerVer = '2.8' } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) // Support lib compile "com.android.support:appcompat-v7:${supportLibVer}" kapt "com.google.dagger:dagger-compiler:${daggerVer}" compile "com.google.dagger:dagger:${daggerVer}" provided "javax.annotation:jsr250-api:${javaxVer}" compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" } repositories { mavenCentral() }
Run your application with ./gradlew clean build
command to see what's exactly wrong with your code. Just paste it into the Terminal in Android Studio.
If you are using the Room database and getting a KAPT error, just check your
It's a problem arising due to improper usage of annotations of Room. For more information use your build logs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With