【问题标题】:Error retrieving parent for item: No resource found that matches the given name [duplicate]检索项目的父项时出错:找不到与给定名称匹配的资源 [重复]
【发布时间】:2018-01-27 17:14:48
【问题描述】:

我的 v24/values-v24.xml 文件中的 Android Studio 出现 4 个错误,该文件位于此处:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Base.TextAppearance.AppCompat.Widget.Button.Borderless.Colored" parent="android:TextAppearance.Material.Widget.Button.Borderless.Colored"/>
<style name="Base.TextAppearance.AppCompat.Widget.Button.Colored" parent="android:TextAppearance.Material.Widget.Button.Colored"/>
<style name="TextAppearance.AppCompat.Notification.Info.Media"/>
<style name="TextAppearance.AppCompat.Notification.Media"/>
<style name="TextAppearance.AppCompat.Notification.Time.Media"/>
<style name="TextAppearance.AppCompat.Notification.Title.Media"/>

以下是四个错误:

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

知道如何解决这个问题吗?这与我的 targetSDKversion 为 23 有什么关系吗?

【问题讨论】:

    标签: android mobile


    【解决方案1】:

    接下来你需要做的:

    File->Import (android-sdk\extras\android\support\v7). Choose "AppCompat"
    
    Project-> properties->Android. In the section library "Add" and choose "AppCompat"
    

    就是这样!

    检查@Svyatoslav Lobach 的答案here

    【讨论】:

    • 抱歉,您是说导入设置吗?这是我可以在“文件”下找到的唯一选项。
    • 该答案适用于较旧的(2013 年)版本的 Android Studio,因此我无法找到该特定路径。在“支持”文件夹中有一个名为 appcompat-v7 的文件夹,它有一系列不同版本的 appcompat 文件,从 18.0.0 到 26.0.0(每个版本都是一个文件夹,其中有一堆不同的“appcompact”其中的文件)。你知道我应该特别添加哪一个吗?
    猜你喜欢
    • 2016-09-28
    • 2017-10-27
    • 2014-06-04
    • 2017-02-10
    • 2017-06-27
    • 2017-09-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多