Gradle DSL method not found: 'kapt()'

后端 未结 7 1290
暖寄归人
暖寄归人 2020-12-14 05:15

Gradle DSL method not found: \'kapt()\' Possible causes: The project \'jetpacklearn\' may be using a version of the Android Gradle plug-in that does not contain the method (

相关标签:
7条回答
  • 2020-12-14 05:38

    The answer https://stackoverflow.com/a/56101024/6007104 is absolutely correct.

    But, for people using the gradle plugins block, it looks like this:

    plugins {
        id('kotlin-kapt')
    }
    
    0 讨论(0)
  • 2020-12-14 05:42

    add this line

    apply plugin: 'kotlin-kapt'
    

    if you used kapt in android library you must add kotlin-android plugin in your project

    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-kapt'
    
    0 讨论(0)
  • 2020-12-14 05:43

    Add this in your build.gradle then sync the gradle again.

    apply plugin: 'kotlin-kapt'

    0 讨论(0)
  • 2020-12-14 05:44

    Check if you have this in top of your app build.gradle?

    apply plugin: 'kotlin-kapt'
    
    0 讨论(0)
  • 2020-12-14 05:48

    just add this line in your app-level of build.grale :

    apply plugin: 'kotlin-kapt'
    

    NOTE: under apply plugin: 'com.android.application'

    0 讨论(0)
  • 2020-12-14 05:54

    Your build.Gradle file should have these at the top

    apply plugin: 'com.android.application'
    apply plugin: 'kotlin-android'
    apply plugin: 'kotlin-kapt'
    
    0 讨论(0)
提交回复
热议问题