butterknife
butterknife copied to clipboard
Can't generate ViewBinding Code
`buildscript { ext.kotlin_version = '1.4.21'
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
}
}this is my project gradle
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
android { compileSdkVersion 30 buildToolsVersion "30.0.3" defaultConfig { minSdkVersion 16 targetSdkVersion 30 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" kapt { arguments { arg("AROUTER_MODULE_NAME", project.getName()) } } }
buildFeatures {
viewBinding true
}
viewBinding {
enabled = true
}
sourceSets {
main {
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
}
buildTypes {
debug {
// 显示Log
buildConfigField "boolean", "LOG_DEBUG", "true"
}
release {
// 不显示Log
buildConfigField "boolean", "LOG_DEBUG", "false"
}
}
useLibrary 'org.apache.http.legacy'
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
kotlinOptions {
jvmTarget = '1.8'
}
}
def ktxVersion = "2.3.0"
dependencies { api fileTree(include: ['*.jar'], dir: 'libs') api 'com.jakewharton:butterknife:10.2.3' api 'androidx.lifecycle:lifecycle-extensions:2.2.0' api "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" api 'androidx.core:core-ktx:1.3.2' api "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.3" api 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.3' api "androidx.lifecycle:lifecycle-viewmodel-ktx:$ktxVersion" api "androidx.lifecycle:lifecycle-livedata-ktx:$ktxVersion" api "androidx.activity:activity-ktx:1.2.2" api 'androidx.fragment:fragment-ktx:1.3.2' }` and this is my base module gradle
`apply plugin: 'com.android.application' apply plugin: 'org.greenrobot.greendao' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt'
android { compileSdkVersion 30 buildToolsVersion "30.0.3" defaultConfig { applicationId "com.nucarf.member" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion 30 } }
buildFeatures {
viewBinding true
}
kotlinOptions {
jvmTarget = '1.8'
}
repositories { flatDir { dirs 'libs' } } pendencies {
kapt 'com.jakewharton:butterknife-compiler:10.2.3'
}
this is my app gradle ,app depends on base module .but in my app 's build dir generated/ap_generated_sources,can't generate code
`