首页 > 解决方案 > 尽管我拥有所有资源文件,但 Android 资源链接失败 | 科特林

问题描述

错误截图

每当我在模拟器中运行应用程序时,它都会显示上述错误。但我有所有的资源文件。

应用目录

屏幕截图中显示的依赖项。gradle 的其他部分是:

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.example.modshabuisness"
        minSdkVersion 16
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}

标签: androidgradleresources

解决方案


你清理和重建项目了吗?您能否在您的 xml 文件中检查多个 xml 选择器<?xml version="1.0" encoding="utf-8"?> ,如果通过删除其他文件来保持它的单一性。


推荐阅读