Android Studio 3.2 ERROR resource linking failed Style.xml问题

标签 android gradle resources styles

这是输出错误,大部分错误与我的/values 相关联 -->/style.xml 我不知道如何解决这个错误我已经卸载了 android studio 并再次下载它但是错误重复了它自己帮助!!!!需要 !!!

Output:  warn: removing resource com.example.ahsan.tree:string/abc_action_bar_home_description without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_action_bar_up_description without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_action_menu_overflow_description without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_action_mode_done without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_activity_chooser_view_see_all without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_activitychooserview_choose_application without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_capital_off without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_capital_on without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_menu_alt_shortcut_label without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_menu_ctrl_shortcut_label without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_menu_delete_shortcut_label without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_menu_enter_shortcut_label without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_menu_function_shortcut_label without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_menu_meta_shortcut_label without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_menu_shift_shortcut_label without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_menu_space_shortcut_label without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_menu_sym_shortcut_label without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_prepend_shortcut_label without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_search_hint without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_searchview_description_clear without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_searchview_description_query without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_searchview_description_search without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_searchview_description_submit without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_searchview_description_voice without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_shareactionprovider_share_with without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_shareactionprovider_share_with_application without required default value.
warn: removing resource com.example.ahsan.tree:string/abc_toolbar_collapse_description without required default value.
warn: removing resource com.example.ahsan.tree:string/search_menu_title without required default value.
warn: removing resource com.example.ahsan.tree:string/status_bar_notification_info_overflow without required default value.
error: resource style/Theme.AppCompat.Light.DarkActionBar (aka com.example.ahsan.tree:style/Theme.AppCompat.Light.DarkActionBar) not found.

这些是主要是 style.xml 的错误命令

    C:\Users\Ahsan\AndroidStudioProjects\tree\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:9: error: style attribute 'attr/colorPrimary (aka com.example.ahsan.tree:attr/colorPrimary)' not found.
C:\Users\Ahsan\AndroidStudioProjects\tree\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:10: error: style attribute 'attr/colorPrimaryDark (aka com.example.ahsan.tree:attr/colorPrimaryDark)' not found.
C:\Users\Ahsan\AndroidStudioProjects\tree\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:11: error: style attribute 'attr/colorAccent (aka com.example.ahsan.tree:attr/colorAccent)' not found.
error: resource style/Base.Theme.AppCompat.Dialog.FixedSize (aka com.example.ahsan.tree:style/Base.Theme.AppCompat.Dialog.FixedSize) not found.
error: resource style/Base.Theme.AppCompat.Light.Dialog.FixedSize (aka com.example.ahsan.tree:style/Base.Theme.AppCompat.Light.Dialog.FixedSize) not found.
error: resource style/Base.Widget.AppCompat.DrawerArrowToggle.Common (aka com.example.ahsan.tree:style/Base.Widget.AppCompat.DrawerArrowToggle.Common) not found.
C:\Users\Ahsan\AndroidStudioProjects\tree\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-hdpi-v4\values-hdpi-v4.xml:4: error: style attribute 'attr/barLength (aka com.example.ahsan.tree:attr/barLength)' not found.
C:\Users\Ahsan\AndroidStudioProjects\tree\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-hdpi-v4\values-hdpi-v4.xml:5: error: style attribute 'attr/gapBetweenBars (aka com.example.ahsan.tree:attr/gapBetweenBars)' not found.
C:\Users\Ahsan\AndroidStudioProjects\tree\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-hdpi-v4\values-hdpi-v4.xml:6: error: style attribute 'attr/drawableSize (aka com.example.ahsan.tree:attr/drawableSize)' not found.
error: resource style/Theme.AppCompat (aka com.example.ahsan.tree:style/Theme.AppCompat) not found.
error: resource style/Theme.AppCompat (aka com.example.ahsan.tree:style/Theme.AppCompat) not found.
error: resource style/Theme.AppCompat.Dialog (aka com.example.ahsan.tree:style/Theme.AppCompat.Dialog) not found.
error: resource style/Theme.AppCompat.Dialog.Alert (aka com.example.ahsan.tree:style/Theme.AppCompat.Dialog.Alert) not found.
error: resource style/Theme.AppCompat.Dialog.MinWidth (aka com.example.ahsan.tree:style/Theme.AppCompat.Dialog.MinWidth) not found.
error: resource style/Theme.AppCompat.DialogWhenLarge (aka com.example.ahsan.tree:style/Theme.AppCompat.DialogWhenLarge) not found.
error: resource style/Theme.AppCompat.NoActionBar (aka com.example.ahsan.tree:style/Theme.AppCompat.NoActionBar) not found.
error: failed linking references.

Command: C:\Users\Ahsan\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.0-4818971-windows.jar\fff13b5cf61430cfb7ed93349534cd31\aapt2-3.2.0-4818971-windows\aapt2.exe link -I\
        C:\Users\Ahsan\AppData\Local\Android\Sdk\platforms\android-28\android.jar\
        --manifest\

        C:\Users\Ahsan\AndroidStudioProjects\tree\app\build\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
        -o\
        C:\Users\Ahsan\AndroidStudioProjects\tree\app\build\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
        -R\
        @C:\Users\Ahsan\AndroidStudioProjects\tree\app\build\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
        --auto-add-overlay\
        --java\
        C:\Users\Ahsan\AndroidStudioProjects\tree\app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
        --custom-package\
        com.example.ahsan.tree\
        -0\
        apk\
        --no-version-vectors

这是守护进程错误

Daemon:  AAPT2 aapt2-3.2.0-4818971-windows Daemon #0

图片

Style.xml image of error code

Build.gradle (Module:app) image

Build.gradle (Project:app_name) image

Main Activity Image

最佳答案

最近我遇到了这个问题。我做错的是错误地将 xml header 放了两次,如下所示:

<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners android:radius="100dp" />
    <solid android:color="#41ba7a" />
    <stroke
        android:width="3dip"
        android:color="#f9f9f9" />
    <padding
        android:bottom="4dp"
        android:left="4dp"
        android:right="4dp"
        android:top="4dp" />
</shape>

希望它能帮到你。

关于Android Studio 3.2 ERROR resource linking failed Style.xml问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52743243/

相关文章:

database - 生物信息学数据库有负面结果?

android - 显示警报并移动到下一个 Activity

android - 使用 onTouchEvent 时无法拖动某些区域

java - gradle 无法检测到模块

android - 无法让 dokka 在 gradle/android 项目上生成 kotlin 文档

android - 将 Android 菜单 XML 资源解析为对象列表

java - Android java 在 thread.start 后崩溃

android - window.FirebasePlugin.verifyPhoneNumber 函数响应无法使用

java - Gradle资源文件冲突解决(log4j2.xml)

android - 在 Android 首选项中使用图标