【问题标题】:Error retrieving parent for item in android studio 2.3在 android studio 2.3 中检索项目的父项时出错
【发布时间】:2017-09-09 08:33:33
【问题描述】:

这些是我面临的一些错误,此处发布的答案不是 也帮助我。也许任何人都可以提出其他建议:

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'.
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

这是我的 gradle 文件,我不明白为什么它不接受 更新的 gradle 构建:

apply plugin: 'com.android.application'


android {
    compileSdkVersion 23
    buildToolsVersion '25.0.2'

    defaultConfig {
        applicationId "com.allianz.azemployee"
        minSdkVersion 16
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.squareup.okhttp3:okhttp:3.4.1'
    compile 'com.google.android.gms:play-services-gcm:10.2.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'com.google.code.gson:gson:2.7'
    compile 'com.github.szugyi:Android-CircleMenu:1.1.2'
    compile 'com.bcgdv.asia.lib:fanmenu:1.2'
}

apply plugin: 'com.google.gms.google-services'

我一直在尝试 stackoverflow 的一些选项,但似乎没有一个有效。 compile 'com.android.support:appcompat-v7:23.4.0' 带有红色下划线 This support library should not use a different version(25) than the compile version (23) 这是什么意思?还有什么是 XML 中的错误?

更新 我现在遇到了这个错误:

Error:(24, 25) No resource found that matches the given name (at 'background' with value '@color/common_action_bar_splitter').
/Users/AmosPune/Desktop/AZEmployee_2_sept_final/AZEmployee_2_sept_final/app/src/main/res/layout/tab_layout.xml
/Users/AmosPune/Desktop/AZEmployee_2_sept_final/AZEmployee_2_sept_final/app/build/intermediates/res/merged/debug/layout/tab_layout.xml
Error:(24, 25) No resource found that matches the given name (at 'background' with value '@color/common_action_bar_splitter').
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt

【问题讨论】:

标签: android android-styles


【解决方案1】:

第 1 步

第一次调用 compileSdkVersion 25 .

compileSdkVersion 25 
buildToolsVersion '25.0.2'

第 2 步

您应该使用 v7:25.2.0/v7:25.3.1 版本而不是 v7:23.4.0

 compile 'com.android.support:appcompat-v7:25.2.0' //or 25.3.1

然后Clean-Rebuild-RestartRun

【讨论】:

  • 谢谢我这样做了,但遇到了另一个错误,我将在问题中作为更新发布。
  • 当前版本为 25.3.1。 See this
  • @AlbAtNf 确实如此。
  • 我已经添加了新的错误,请您看一下。
  • @KaranThakkar 好吧。显示使用 common_action_bar_splitter 的行
猜你喜欢
  • 1970-01-01
  • 2016-03-04
  • 1970-01-01
  • 2016-08-15
  • 2016-02-26
  • 2015-02-10
  • 1970-01-01
  • 1970-01-01
  • 2014-12-22
相关资源
最近更新 更多