jjzjj

android - 检索项目 : No resource found that matches the given name after upgrading to AppCompat v23 的父项时出错

coder 2023-05-06 原文

我一直使用 Eclipse 编写 Android 并决定开始迁移到 Android Studio .我决定使用与 Eclipse 相同的 SDK,然后:

  • 开始一个新项目
  • 设置最低 SDK 4.0(API 级别 14)
  • 选择空白 Activity 选项
  • 使用默认名称作为 Activity 名称和布局名称
  • 点击完成

几秒钟后,Gradle 完成了构建,它在文件 Teste4\app\build\intermediates/exploded-aar\com.android.support\appcompat-v7\23.0.0\中向我抛出了两个错误并显示以下消息res\values-v23\values-v23.xml:

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

文件->项目结构->模块:app(左栏)->属性选项卡下,我设置了以下版本:

  • “编译 SDK 版本”:Android 5.1(API 级别 22)
  • “构建工具版本”:23.0.2

我应该怎么做才能解决这个问题?

我已经尝试过 Stack Overflow 问题 appcompat-v7:21.0.0': No resource found that matches the given name: attr 'android:actionModeShareDrawable' 中的建议。 ,但是没有用。

最佳答案

您的编译 SDK 版本必须与支持库的主要版本匹配。

由于您使用的是版本 23 的支持库,因此您需要针对版本 23 的 Android SDK 进行编译。

或者,您可以通过切换到最新的支持库 v22 来继续针对 Android SDK 版本 22 进行编译。

关于android - 检索项目 : No resource found that matches the given name after upgrading to AppCompat v23 的父项时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32075498/

有关android - 检索项目 : No resource found that matches the given name after upgrading to AppCompat v23 的父项时出错的更多相关文章

随机推荐