Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate ViewBinding Code #1662

Open
lalozhang opened this issue Jun 30, 2021 · 0 comments
Open

Can't generate ViewBinding Code #1662

lalozhang opened this issue Jun 30, 2021 · 0 comments

Comments

@lalozhang
Copy link

`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

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant