首页 文章

无法使用kotlin-kapt与kotlin / native

提问于
浏览
0

在常见的kotlin / native模块中使用时,编译器无法识别任何kapt依赖项

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)
}

2 回答

  • 0

    Kotlin / Native目前不支持kapt或任何其他kotlinx库 . 我们可以在应用程序的android平台中使用kapt,但不能在主要的公共模块本身中使用 .

  • 1
    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-android-extensions'
    apply plugin: 'kotlin-kapt'
    
    
    buildscript {
        ext.kotlin_version = '1.2.10'
        repositories {
            google()
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.2'
            classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    

相关问题