首页 > 解决方案 > 数据绑定在动态fature模块中不起作用

问题描述

我最近一直在研究动态功能模块,里面的数据绑定根本不工作,并且给出了找不到类的运行时错误。

apply plugin: "com.android.dynamic-feature"

android {
    compileSdkVersion 29
    buildToolsVersion "30.0.2"


    dataBinding {
    enabled = true
    }

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        vectorDrawables.useSupportLibrary = true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation project(":app")

   
    implementation 'org.jetbrains:annotations:16.0.1'

    implementation 'com.jakewharton.timber:timber:4.7.1'

  

}

请帮助我如何在我的功能模块中启用数据绑定。

标签: androidandroid-databindingdynamic-feature-module

解决方案


推荐阅读