android - 编译语言res文件时出现AAPT错误

标签 android compiler-errors android-resources aapt

在更新之前,我构建的应用程序运行良好,之后所有应用程序在某些情况下均显示此错误,例如
错误显示

C:\Users\INS5567\Documents\CleanOnDemand\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-watch-v21\values-watch-v21.xml: AAPT: error: file failed to compile.

与语言相关的大多数文件都显示相同的错误,例如
C:\Users\INS5567\Documents\CleanOnDemand\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-watch-v20\values-watch-v20.xml: AAPT: error: file failed to compile.

build.gradle
    apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "org.wazir.build.cleanondemand"
        minSdkVersion 20
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}
apply plugin: 'com.android.application'
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'

    // Firebase plugin
    implementation 'com.google.firebase:firebase-analytics:17.2.1'

    // managing multi dex files
    def multidex_version = "2.0.1"
    implementation "androidx.multidex:multidex:$multidex_version"

    // dependency for sticky switch
    implementation 'com.github.GwonHyeok:StickySwitch:0.0.15'

    // recyclerview dependency
    implementation 'com.android.support:recyclerview-v7:28.0.0'

    // cardview
    implementation 'com.android.support:cardview-v7:28.0.0'


    // picaso files
    implementation 'com.squareup.picasso:picasso:2.71828'

    // circular ImageView
    implementation 'com.mikhaellopez:circularimageview:4.0.2'

    implementation 'com.google.firebase:firebase-auth:19.1.0'
    implementation 'com.google.firebase:firebase-firestore:21.2.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.firebase:firebase-storage:19.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    //here is the navigation dependency
    implementation 'com.google.android.material:material:1.0.0'
}
apply plugin: 'com.google.gms.google-services'

这是我们在许多类似文件中显示的错误
    <?xml version="1.0" encoding="utf-8"?>
<resources xmlns:ns1="urn:oasis:names:tc:xliff:document:1.2">
    <string msgid="7903180715631665059" name="abc_action_bar_home_description">"Navegar para a página inicial"</string>
    <string msgid="6794660482873516081" name="abc_action_bar_up_description">"Navegar para cima"</string>
    <string msgid="1155814932213556626" name="abc_action_menu_overflow_description">"Mais opções"</string>
    <string msgid="2571498368472823490" name="abc_action_mode_done">"Concluído"</string>
    <string msgid="3732416590524162402" name="abc_activity_chooser_view_see_all">"Ver tudo"</string>
    <string msgid="1798588241954930982" name="abc_activitychooserview_choose_application">"Selecionar um app"</string>
    <string msgid="3403923230105792483" name="abc_capital_off">"DESATIVADO"</string>
    <string msgid="7831734969929204599" name="abc_capital_on">"ATIVADO"</string>
    <string msgid="5725160506500770567" name="abc_menu_alt_shortcut_label">"Alt+"</string>
    <string msgid="944415252197684443" name="abc_menu_ctrl_shortcut_label">"Ctrl+"</string>
    <string msgid="129742188101734366" name="abc_menu_delete_shortcut_label">"delete"</string>
    <string msgid="6840127756824236027" name="abc_menu_enter_shortcut_label">"enter"</string>
    <string msgid="4974283687810130415" name="abc_menu_function_shortcut_label">"Function+"</string>
    <string msgid="8046416353848716905" name="abc_menu_meta_shortcut_label">"Meta+"</string>
    <string msgid="3271697756921353410" name="abc_menu_shift_shortcut_label">"Shift+"</string>
    <string msgid="2304645930658438191" name="abc_menu_space_shortcut_label">"espaço"</string>
    <string msgid="8327365089695024394" name="abc_menu_sym_shortcut_label">"Sym+"</string>
    <string msgid="3570106412128999382" name="abc_prepend_shortcut_label">"Menu+"</string>
    <string msgid="940844115270746197" name="abc_search_hint">"Pesquisar…"</string>
    <string msgid="1769270744562318534" name="abc_searchview_description_clear">"Limpar consulta"</string>
    <string msgid="908784302972860853" name="abc_searchview_description_query">"Consulta de pesquisa"</string>
    <string msgid="5466662225065974044" name="abc_searchview_description_search">"Pesquisar"</string>
    <string msgid="8203855622131699655" name="abc_searchview_description_submit">"Enviar consulta"</string>
    <string msgid="3478748990613108725" name="abc_searchview_description_voice">"Pesquisa por voz"</string>
    <string msgid="2650565705514630347" name="abc_shareactionprovider_share_with">"Compartilhar com"</string>
    <string msgid="9009661856846212431" name="abc_shareactionprovider_share_with_application">"Compartilhar com <ns1:g id="APPLICATION_NAME">%s</ns1:g>"</string>
    <string msgid="6389460216547290468" name="abc_toolbar_collapse_description">"Recolher"</string>
    <string msgid="730395136688082741" name="search_menu_title">"Pesquisar"</string>
    <string msgid="8106346172024741305" name="status_bar_notification_info_overflow">"999+"</string>
</resources>

我不知道是什么原因导致此错误

最佳答案

将您的 gradle 更新到项目和应用程序级别的最新版本,然后使缓存无效并重新启动。这对我有用。
这是我得到答案的地方:how to fix eror app\build\intermediates\res\merged\debug\values-v24\values-v24.xml

关于android - 编译语言res文件时出现AAPT错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58835333/

相关文章:

Android 应用程序退出事件

xml - 运行ant build.xml时出错

typescript - VS Code 提示错误 TS7013 但 Typescript 不是

从C编译错误gcc调用Assembly

android - 如何知道哪个手机支持哪个布局(hdpi、mdpi 和 xhpi)?

java - 如何处理大量动画 vector 绘图?

java - 我的 Android 应用程序找不到 XML 文件中声明的按钮

android - 如何以编程方式将菜单项添加到由 Android 导航 View 中的 findViewById 在 XML 中创建的子菜单?

android - 在 OpenGL ES 1.1 中快速绘制许多纹理粒子

Android:以编程方式打开 "Recent Apps"对话框