相关疑难解决方法(0)

错误:找不到符号导入com.gourav.news.databinding.ActivityDetailBindingImpl;

我尝试构建应用程序,但不断获取/Users/gouravkarwasara/Desktop/News2/app/build/generated/source/kapt/debug/com/gourav/news/DataBinderMapperImpl.java:9:错误:找不到符号导入com.gourav .news.databinding.ActivityDetailBindingImpl; ^符号:类ActivityDetailBindingImpl位置:包com.gourav.news.databinding

这个错误。

我试过清理并构建无效并重新启动

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.gourav.news"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    dataBinding {
        enabled = true
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
   implementation 'androidx.appcompat:appcompat:1.1.0-alpha02'
   implementation 'androidx.core:core-ktx:1.1.0-alpha04'
   implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
   testImplementation 'junit:junit:4.12'
   androidTestImplementation 'androidx.test:runner:1.1.2-alpha01'
   androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.2-alpha01'

   implementation "androidx.lifecycle:lifecycle-extensions:2.0.0"
   kapt "androidx.lifecycle:lifecycle-compiler:2.0.0"
   implementation "androidx.room:room-runtime:2.0.0" …
Run Code Online (Sandbox Code Playgroud)

kotlin android-databinding androidx

5
推荐指数
2
解决办法
1704
查看次数

标签 统计

android-databinding ×1

androidx ×1

kotlin ×1