报错error: resource style/Theme.AppCompat.Light.DarkActionBar (aka com.xxx.xxx:style/Theme)not found.
报错内容如下:
error: resource style/Theme.AppCompat.Light.DarkActionBar (aka com.xxx.xxx:style/Theme.AppCompat.Light.DarkActionBar) not found.
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/windowNoTitle (aka com.xxx.xxxx:attr/windowNoTitle)\u0027 not found.","sources":[{"file":"D:\\Prj\\prj1\\src\\main\\res\\values\\styles.xml","position":{"startLine":41,"startColumn":4,"startOffset":1719,"endColumn":90,"endOffset":1805}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/windowActionBar (aka com.xxx.xxx:attr/windowActionBar)\u0027 not found.","sources":[{"file":"D:\\Prj\\prj1\\src\\main\\res\\values\\styles.xml","position":{"startLine":41,"startColumn":4,"startOffset":1719,"endColumn":90,"endOffset":1805}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/colorPrimary (aka com.xxx.xxx:attr/colorPrimary)\u0027 not found.","sources":[{"file":"D:\\Prj\\prj1\\src\\main\\res\\values\\styles.xml","position":{"startLine":41,"startColumn":4,"startOffset":1719,"endColumn":90,"endOffset":1805}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/colorPrimaryDark (aka com.xxx.xxx:attr/colorPrimaryDark)\u0027 not found.","sources":[{"file":"D:\\Prj\\prj1\\src\\main\\res\\values\\styles.xml","position":{"startLine":41,"startColumn":4,"startOffset":1719,"endColumn":90,"endOffset":1805}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/colorAccent (aka com.xxx.xxx:attr/colorAccent)\u0027 not found.","sources":[{"file":"D:\\Prj\\prj1\\src\\main\\res\\values\\styles.xml","position":{"startLine":41,"startColumn":4,"startOffset":1719,"endColumn":90,"endOffset":1805}}],"original":"","tool":"AAPT"}
error: resource style/ThemeOverlay.AppCompat.Dark.ActionBar (aka com.xxx.xxx:style/ThemeOverlay.AppCompat.Dark.ActionBar) not found.
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/windowActionBar (aka com.xxx.xxx:attr/windowActionBar)\u0027 not found.","sources":[{"file":"D:\\Prj\\prj1\\src\\main\\res\\values\\styles.xml","position":{"startLine":43,"startColumn":4,"startOffset":1813,"endColumn":80,"endOffset":1889}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/windowNoTitle (aka com.xxx.xxx:attr/windowNoTitle)\u0027 not found.","sources":[{"file":"D:\\Prj\\prj1\\src\\main\\res\\values\\styles.xml","position":{"startLine":43,"startColumn":4,"startOffset":1813,"endColumn":80,"endOffset":1889}}],"original":"","tool":"AAPT"}
error: resource style/ThemeOverlay.AppCompat.Light (aka com.xxx.xxx:style/ThemeOverlay.AppCompat.Light) not found.
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/windowActionBar (aka com.xxx.xxx:attr/windowActionBar)\u0027 not found.","sources":[{"file":"D:\\Prj\\prj1\\build\\intermediates\\packaged_res\\debug\\values\\values.xml","position":{"startLine":257,"startColumn":4,"startOffset":13739,"endLine":262,"endColumn":12,"endOffset":14018}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/colorPrimary (aka com.xxx.xxx:attr/colorPrimary)\u0027 not found.","sources":[{"file":"D:\\JiCao\\jicaolibrary\\build\\intermediates\\packaged_res\\debug\\values\\values.xml","position":{"startLine":238,"startColumn":4,"startOffset":11253,"endLine":244,"endColumn":12,"endOffset":11641}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/colorPrimaryDark (aka com.xxx.xxx:attr/colorPrimaryDark)\u0027 not found.","sources":[{"file":"D:\\Prj\\prj2\\build\\intermediates\\packaged_res\\debug\\values\\values.xml","position":{"startLine":238,"startColumn":4,"startOffset":11253,"endLine":244,"endColumn":12,"endOffset":11641}}],"original":"","tool":"AAPT"}
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/colorAccent (aka com.xxx.xxx:attr/colorAccent)\u0027 not found.","sources":[{"file":"D:\\Prj\\prj1\\build\\intermediates\\packaged_res\\debug\\values\\values.xml","position":{"startLine":238,"startColumn":4,"startOffset":11253,"endLine":244,"endColumn":12,"endOffset":11641}}],"original":"","tool":"AAPT"}
error: resource style/Theme.AppCompat.Light.NoActionBar (aka com.xxx.xxx:style/Theme.AppCompat.Light.NoActionBar) not found.
error: resource style/Widget.AppCompat.ListPopupWindow (aka com.xxx.xxx:style/Widget.AppCompat.ListPopupWindow) not found.
error: resource style/Theme.AppCompat.Dialog (aka com.xxx.xxx:style/Theme.AppCompat.Dialog) not found.
error: resource style/Theme.AppCompat.NoActionBar (aka com.xxx.xxx:style/Theme.AppCompat.NoActionBar) not found.
AGPBI: {"kind":"error","text":"error: style attribute \u0027attr/colorPrimary (aka com.xxx.xxx:attr/colorPrimary)\u0027 not found.","sources":[{"file":"D:\\Prj\\RCSticker\\build\\intermediates\\packaged_res\\debug\\values\\values.xml","position":{"startLine":21,"startColumn":4,"startOffset":1211,"endColumn":71,"endOffset":1278}}],"original":"","tool":"AAPT"}
:engineer:processDebugResources FAILEDFAILURE: Build failed with an exception.
注意:本处的com.xxx.xxx是博主自己处理过,避免泄露自己项目的包名而修改的。
先说说怎么就出现了这个错误吧。
这个错误是突然就出现了,没有任何征兆它就出来了,导致我的项目无法正常运行了。(我了解此时你无辜的眼神,无辜的模样,别哭别哭。)反正咱们也不能跑路,除了解决还能怎么着啊。
如果你没做什么操作,项目突然出现这种问题,建议如下:
1.你首先考虑可能是gradle版本不一致导致的。(你project下的build.gradle里的classpath的版本和你project下的.gradle文件不一致。)
这下面是现目前所出的版本对应(左边是你build.gradle中的版本,右边是.gradle文件下的版本)
你如果发现自己的版本无法匹配,那么你可以删除项目中的.gradle和idea。
上面的删除操作后,关闭android studio,然后重新又打开,它会重新根据你build.gradle中的gradle版本进行构建新的.gradle(过程可能略慢,耐心等待一下)。
这时你再重新跑你的程序,应该就没有问题了。
tips:如果你的项目的内容突然缺失,比如id,引用的style等报找不到,你不要慌张,一般这种情况不是你代码的问题(抛开你的xml,style等标签的错误),那剩下的就一般都是你一些配置出问题了。不要去乱改你已经写好了的代码!切记!
一下是我尝试过的一些方法,我写出来,万一大家觉得有用,可以try一下。
1.项目报这种错,我一般都是三步走,clean,rebuild,Invalidate Caches/Restart。
.
要是这三步没作用,那就看错,一般rebuild会重现错误。
2.再就是使用这个。Sync Project with Gradle Files
3.在project下的gradle.properties,修改成:android.enableAdapter=true。
4.你要是上面的都没法了,那你就把项目删了,从git上重新拉一次吧。(要是拉了依然报错,那我也没办法了,谁给你挖的坑,那就去打他一顿吧。)
差不多就是上面的方法了,自求多福吧,反正也不能跑路,只能慢慢解决了。遇事要冷静,你要是慌了就更找不到问题所在了,冷静下来吧。
报错error: resource style/Theme.AppCompat.Light.DarkActionBar (aka com.xxx.xxx:style/Theme)not found.相关推荐
- Android ionic resource style/Theme.AppCompat.Light.NoActionBar (aka x.x.x:style/Theme.AppCompa
error: resource style/Theme.AppCompat.Light.NoActionBar (aka 包名:style/Theme.AppCompat.Light.NoAction ...
- Android问题集锦之三十七:No resource found 'Theme.AppCompat.Light.DarkActionBar'
AS导入他人的工程会遇到这样那样的问题. 如果他们用的AS版本比较老,那么需要AS会自动下载相对应版本的gradle.这个我在前几篇文中有提过.不过最简单的版本就是直接将gradle的版本改成最新. ...
- No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'
解决方法: styles.xml中<style name="AppBaseTheme" parent="Theme.AppCompat.Light"> ...
- 解决报错error resource androidattrdialogCornerRadius not found
解决报错error: resource android:attr/dialogCornerRadius not found 1.问题描述 运行Android Studio程序,产生报错error: r ...
- Theme.AppCompat.Light.DarkActionBar 找不到
问题: 由于更新了Android的sdk,之前的项目打开之后提示Theme.AppCompat.Light.DarkActionBar主题找不到了. 原因: SDK更新之后,主题的目录可能在新版本里面 ...
- Python pip install 安装包报错ERROR: Could not find a version that satisfies the requirement XXX解决方法
Python pip install 安装包报错ERROR: Could not find a version that satisfies the requirement XXX解决方法 文章目录 ...
- Python安装包报错ERROR: Could not find a version that satisfies the requirement XXX解决方法
我们在使用 pip 安装 python 包时,经常会出现如下错误: ERROR: Could not find a version that satisfies the requirement xxx ...
- 修复报错 Error in render: “TypeError: Cannot read properties of undefined (reading ‘xxx‘)“
请求接口时,能够完整渲染出整体界面无问题,但是一刷新所渲染的界面就没了,并且开发者工具报出"Error in render: "TypeError: Cannot read pro ...
- git报错error: failed to push some refs to ‘https://gitee.com/XXX/XXX-mater.git‘
报错地方和修改: 解决方法: 1.输入命令: git pull --rebase origin master 先取消commit记录,之后同步远程库到本地,然后再将本地最新的重新push提交就行了. ...
最新文章
- 别怕,BCH无惧攻击
- 子类访问父类和方法覆写
- 小鱼便签_同样是写便签,这样更酷
- HTML手机上图片显示被压扁,在重新调整Web浏览器HTML |时,文本会被压扁CSS
- java底层机制_Java同步机制的底层实现
- 联发科推全新P系芯片 聚焦中端市场
- 面经——操作系统(linux为例)
- InnoDB存储引擎--学习笔记-redo log
- 论文中MathType公式居中,编号右对齐
- Linux iproute2 命令家族(ip / ss)
- 小程序中生成带logo的二维码,有源码
- FCAA答题练习收集记录
- 酒浓码浓 - ios进入页面自动弹出键盘
- 凯翔:可以同时替代Nimble和Nutanix的存储
- 超实用的几个编程学习公众号
- 【UnblockNeteaseMusic】代理网易云后隐藏NODE代理窗口方法
- circular包绘图笔记
- PCB之AD规则设置技巧
- 51 单片机 程序 测量占空比 测量频率 频率计 占空比 proteus
- Gensim训练维基百科词向量模型(含代码)