检索项目的父项时出错 - Android Studio [英] Error retrieving parent for item - Android Studio

查看:26
本文介绍了检索项目的父项时出错 - Android Studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

After downloading the New L SDK and 20 SDK when trying to refresh, build, or clean my project i get a

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'.

这是我的 build.gradle

Here is my build.gradle

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:+'
}

我觉得我几乎什么都试过了,我不知道还能尝试什么.任何帮助将不胜感激.

I feel like ive tried just about everything, I'm not sure what else to try. Any help would be appreciated.

我刚刚从 0.6.0 Canary 升级到新的 Android Studio Beta (0.8.0)

I just upgraded to the new Android Studio Beta (0.8.0) from 0.6.0 Canary

推荐答案

事实证明我必须将目标和编译版本设为 L,这意味着我无法在较旧的 SDK 上运行我的应用程序.如果您希望您的应用在 SDK 19 及更低版本上运行,您必须将编译和目标版本设置为 19,并将最小 SDK 设置为您需要的任何版本.

Turns out that I had to make the target and compile version to L which meant that I could not run my app on older SDKs. If you want your app to run on SDK 19 and lower you have to set your compile and target version to 19 and your min SDK to whatever version you need.

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

Next you have to adjust your imports to the version that is compatible with the SDKs that you have chosen to compile for. For example if you want to use the v7 support library on sdk 19 you must import it like this: compile compile 'com.android.support:appcompat-v7:20.+'

这篇关于检索项目的父项时出错 - Android Studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆