-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文件中,並將其複製並粘貼到現有項目,並處理了我的問題。

相關問題