Android Studio 3.2错误资源链接失败Style.xml问题
这是输出错误,大多数错误与my/values-->/style.xml链接 我不知道如何解决这个错误,我已经卸载了android studio并再次下载了它,但是错误会重复出现,这是我的自助!!!!需要Android Studio 3.2错误资源链接失败Style.xml问题,android,gradle,resources,styles,Android,Gradle,Resources,Styles,这是输出错误,大多数错误与my/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 resour
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
图像
您没有导入
R
导入。也许这就是问题的根源
将鼠标置于main活动
中,它将建议添加R
import,使用ALT+Enter并导入R
然后从
Build
重建项目最近我收到了这个问题。我犯的错误是两次错误地放入xml头,如下所示:
<?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>
希望它能帮到你。请遵循这个
文件-->项目结构-->应用程序(模块内部)-->依赖项--单击“+”-->库依赖项-->搜索“appcompat”,然后单击“com.android.support:appcompat-v7(com.android.support:appcompat-v7:27.1.1)”-->单击确定
这应该可以解决你的错误
检查此链接。你可以在1点35分看到。
更改编译器DKVersion>28欢迎使用SO。它主要来自你的风格和价值观。用:
Theme.AppCompat
代替:style/Theme.AppCompat
,其余的都一样,没有style/
。。另外,在值中,colorPrimary
而不是attr/colorPrimary
。试试看,让我们知道@color/colorPrimary@color/colorPrimaryDark@color/colorAccent这是我当前的风格。xml您会在问题中添加风格或相关代码吗?使用编辑按钮我已经对它进行了一些扩展,我可以看到你的build.gradle
依赖项吗?它给我提供了如下选项:1)创建测试2)创建子类3)添加JavaDoc 4)使包私有化因此比这更复杂。你试过重新启动现金吗?!从Android Studio上的“文件”开始?然后检查是否可以导入R。是否有导入无效的线索?是的,我尝试了重新验证现金重新启动它没有任何效果。你没有尝试创建新项目吗?这是你们面临的非常奇怪和罕见的问题。试着创建一个新项目,然后看看它是否有相同的问题。是的,这就是我的情况。谢谢你,伙计。抄袭和过去是邪恶的。)@A.Kazarovets如果我的答案有帮助,那么放弃投票吧,它会帮助很多人。谢谢。