Search code examples
androidkotlinkaptkotlin-native

Unable to use Kotlin-kapt with kotlin/native


Compiler fails to recognise any kapt dependencies when used in common kotlin/native module

apply plugin: 'konan'
apply plugin: 'kotlin-platform-common'
apply plugin: 'kotlin-kapt'
repositories {
mavenCentral()
}
dependencies {
compile "org.jetbrains.kotlin:kotlin-stdlib"
compile "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
compile "com.jakewharton:butterknife:8.8.1"
//kapt "com.jakewharton:butterknife-compiler:8.8.1"
}

konan.targets = ['iphone', 'iphone_sim']
def frameworkName = 'XplatformAnalytics'
konanArtifacts {
framework(frameworkName)
}

Solution

  • Kotlin/Native currently does not support kapt or any other kotlinx libraries. We can use kapt, in android platform of the app, but not in the main common module itself.