在添加dataBinding标签时找不到资源android:style / TextAppearance.Material.Notification

时间:2019-06-17 06:11:19

标签: java android

在我的应用级Gradle文件中添加dataBinding块时,它显示以下错误:

Android resource linking failed
error: resource android:style/TextAppearance.Material.Notification not found.
error: resource android:style/TextAppearance.Material.Notification.Info not found.
error: resource android:style/TextAppearance.Material.Notification.Time not found.
error: resource android:style/TextAppearance.Material.Notification.Title not found.
error: failed linking references.

此应用最初是在Eclipse上构建的。但现在它正在android studio上运行。该应用程序可以在没有dataBinding块的情况下正常运行。此外,style.xml文件中没有错误。

// build.gradle (Module:app)    

    apply plugin: 'com.android.application'

    android {
        compileSdkVersion 18
        buildToolsVersion "29.0.0"

        defaultConfig {
            applicationId "org.irdresearch.iicsystem"
            minSdkVersion 14
            targetSdkVersion 14
            compileOptions {
                sourceCompatibility JavaVersion.VERSION_1_5
               targetCompatibility JavaVersion.VERSION_1_5
            }
        }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
    dataBinding {
        enabled = true
    }
}

dependencies {
    implementation 'com.android.support:support-v4:18.0.0'
}

1 个答案:

答案 0 :(得分:1)

将compileSdkVersion版本从18更新为29