-1

我将一个旧的Eclipse项目导入到Android Studio中,并且尽力让它编译,同时仍支持SdkVersion 4 。Android的 - 检索项目的父项时出错:未找到与给定名称相匹配的资源'android:WindowTitleBackground'

的build.gradle:

apply plugin: 'com.android.application' 
android { 
    compileSdkVersion 21 
    buildToolsVersion '21.0.0' 

    defaultConfig { 
     applicationId "com.name.name" 
     minSdkVersion 4 
     targetSdkVersion 21 
    } 

    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' 
     } 
    } 
} 

dependencies { 
    compile 'com.android.support:support-v4:21.0.0' 
} 

错误:

Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies] 
C:\Users\me\WORK\ORIGINAL\original_gradle_made\app\build\intermediates\res\merged\debug\values\values.xml 
Error:(206) Error retrieving parent for item: No resource found that matches the given name 'android:WindowTitleBackground'. 
Error:(206) Error retrieving parent for item: No resource found that matches the given name 'android:WindowTitleBackground'. 
Error:Execution failed for task ':app:processDebugResources'. 
> com.android.ide.common.process.ProcessException: Failed to execute aapt 

任何人都知道我失踪或需要更改?

+0

** minSdkVersion 4 **不确定是否存在它的2017年,您的目标受众过多,至少达到14或15个//为什么您要使用min作为4?如果看起来像我的框架错误@ _ @ –

回答

0

尝试将targetSdkVersion 21更改为 - >targetSdkVersion 13。然后cleanrebuild该项目。

+0

请编辑你的答案。它应该是'minSdkVersion' –

+0

@IntelliJAmiya从其他答案,我发现这个问题可能是由设置一个更高的目标sdk引起​​的,我在等他,直到他试试看看它是否有效! – OBX

+0

@OBX我试着将'targetSdkVersion'改为13,没有任何变化。我也尝试改变'minSdkVersion' – Bravepaw

0

我用我需要的选项创建了一个新项目。我将v4支持添加到build.gradle文件中,并将其复制并粘贴到现有项目,并处理了我的问题。

相关问题