Error retrieving parent for item: No resource found that matches the given name 'Widget.

因为我的项目中需要添加一个闹钟的功能,所以就从github上找了一个闹钟项目叫做clockPlus,感觉这个闹钟还不错。然后就打算把这个clockPlus改成library加入到我的项目中去。我的项目 compileSdkVersion是23,但是clockPlus的compileSdkVersion是25,所以要想把clockPlus改成library,就需要把它的compileSdkVersion改为23,因为library的compileSdkVersion与主项目的compileSdkVersion版本必须一致才不会报错。于是我就把clockPlus的compileSdkVersion改为23,截图如下:



同时,也要把clockPlus的v4包、v7包的依赖从25改为23,截图如下:



改完之后点击gradle同步按钮时,就报错了。报错截图如下:



No resource found that matches the given name: attr 'srcCompat'.
No resource found that matches the given name: attr 'srcCompat'.
Error retrieving parent for item: No resource found that matches the given name 'Theme.Design.Light.BottomSheetDialog'.
No resource found that matches the given name: attr 'bottomSheetStyle'.
Error retrieving parent for item: No resource found that matches the given name 'Widget.Design.BottomSheet.Modal'.
No resource found that matches the given name: attr 'behavior_peekHeight'.
No resource found that matches the given name: attr 'srcCompat'.
No resource found that matches the given name: attr 'srcCompat'.
Error retrieving parent for item: No resource found that matches the given name 'Theme.Design.Light.BottomSheetDialog'.
No resource found that matches the given name: attr 'bottomSheetStyle'.
Error retrieving parent for item: No resource found that matches the given name 'Widget.Design.BottomSheet.Modal'.
No resource found that matches the given name: attr 'behavior_peekHeight'.
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt


上面的就是报错日志。


在网上百度了一下也没找到解决办法,反正这个bug就是和v4、v7兼容包有关。于是我打开我的项目看了一下v4、v7包是23.4.0,于是我就把这个clockPlus的v4、v7包的依赖从23.0.0改为了23.4.0试一试。结果bug就没了。app可以正常运行了。截图如下:



所以遇到bug不要慌,要多分析一下是哪些因素导致的bug。然后再着手解决。


如果本文对你有帮助的话,麻烦在左侧点个赞,谢谢支持!


  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值