Android: Kotlin with Butterknife

前端 未结 10 877
鱼传尺愫
鱼传尺愫 2020-12-24 04:55

I\'m trying to use Kotlin with Butterknife for my Android Application.

Here is my build.gradle

dependencies {
    ...
    compile \'com.jakewharton:b         


        
10条回答
  •  醉梦人生
    2020-12-24 05:33

    Add this in your Project Build.gradle

    buildscript {
    ext.kotlin_version = '1.1.2-4'
    ext.butterknife_version = '8.6.0'
    repositories {
        maven { url 'https://maven.google.com' }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath "com.jakewharton:butterknife-gradle-plugin:$butterknife_version"
    
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
       }
    }
    

    And in your app Build.Gradle add this.

        //Butterknife
    compile "com.jakewharton:butterknife:$butterknife_version"
    kapt "com.jakewharton:butterknife-compiler:$butterknife_version"
    

提交回复
热议问题