当前位置: 首页 > 知识库问答 >
问题:

检索项目的父项时出错-Android Studio

景明诚
2023-03-14

下载新的L SDK和20 SDK后,当尝试刷新、构建或清理我的项目时,我会得到一个

Error:Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Subtitle'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
Error:Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Title'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
apply plugin: 'com.android.application'
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+'
    }
}

repositories {
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}


    signingConfigs{
        release {
           ... Stuff Here ...
        }
    }
    buildTypes {
        debug {
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            zipAlign true
            debuggable true
        }
        release {
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            zipAlign true
            signingConfig signingConfigs.release

        }
    }

    dexOptions {
        incremental true
    }
}

android {
    compileSdkVersion 'android-L'
    buildToolsVersion '20.0.0'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 'L'
    }
}


dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    ...
    Some Projects
    ...
    compile 'com.android.support:cardview-v7:+'
    compile 'com.android.support:recyclerview-v7:+'
    compile 'com.android.support:appcompat-v7:+'
}

我觉得我几乎什么都试过了,但我不知道还能试什么。如有任何帮助,我们将不胜感激。

我刚刚从0.6.0 Canary升级到了新的Android Studio测试版(0.8.0

共有1个答案

朱明知
2023-03-14

结果是我必须创建目标并将版本编译为L,这意味着我无法在较旧的SDK上运行我的应用程序。如果您希望您的应用程序运行在SDK 19和更低的版本上,您必须将编译和目标版本设置为19,并将您的min SDK设置为您需要的任何版本。

接下来,您必须将导入调整为与您选择编译的SDK兼容的版本。例如,如果要在sdk 19上使用v7支持库,则必须这样导入:compile compile'com.android.support:appcompat-v7:20.+'

 类似资料:
  • 我是使用eclipse开发android的新手,在创建一个新项目时,我会出现两个错误。一个是在src文件夹里,主要活动说: “C:\users\username\workspace\test\res\values\styles.xml:7:Error:检索项的父项时出错:找不到与给定名称'theme.appcompat.light'匹配的资源。” 我得到了三次相同的错误,一次在values-v11

  • 我试图在我的项目中使用ActionBarActivity。我已经按照https://developer.android.com/tools/support-library/setup.html#中的说明将android-support-v7-appcompat导入到工作区 我可以将appcompat项目作为库添加到当前项目(eclipse)中。 现在我使用下面的import语句时没有错误。 附:我

  • 我有个小问题。我只需要将我的编译android版本从23改为22。当我使用CompileSDK版本23时,一切都很好。一旦我切换到22,它就会产生以下错误。 错误:(2)错误检索项目的父级:没有找到与给定名称'android:文本外观匹配的资源。材料。小部件。按钮。逆'。错误:(2)错误检索项目的父:没有找到与给定名称'android: Widget匹配的资源。材料。按钮。有色'。 我需要解决这个

  • 我正在尝试构建Android支持库v7示例。 (第28行) 如何修复这些错误并构建示例项目?

  • 编译sdk版本为22,构建工具版本为23.0.2。 推送通知库-https://github.com/facebook/fbnotifications 我知道如果我将编译sdk版本更改为23,这个错误就会消失。但是在我的项目中,我使用了一些在23版上不推荐的方法,目前不可能将compile sdk版本更改为23版。 还有其他方法可以消除这个错误吗

  • 如果我完成了定级,我会得到这个错误: 下面是by build.gradle文件的样子: