2015-12-02 73 views
0

這些都是我在的build.gradle錯誤,同時使用支持-v4和和程序兼容性-V7

dependencies { 
compile fileTree(include: ['*.jar'], dir: 'libs') 
compile 'com.android.support:support-v4:23.1.1' 
compile 'com.android.support:appcompat-v7:23.1.1' 
compile files('libs/jdom-2.0.6.jar') 

}

依賴性如果我重建項目,我得到這個錯誤。

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large.Inverse'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium.Inverse'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small.Inverse'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.EditText'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Large'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Medium'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Menu'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Subtitle'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.SearchResult.Title'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Small'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Subhead'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Title'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.TextView.SpinnerItem'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'. 
Error:(121, 22) No resource found that matches the given name: attr 'android:colorAccent'. 
Error:(125, 22) No resource found that matches the given name: attr 'android:colorButtonNormal'. 
Error:(123, 22) No resource found that matches the given name: attr 'android:colorControlActivated'. 
Error:(124, 22) No resource found that matches the given name: attr 'android:colorControlHighlight'. 
Error:(122, 22) No resource found that matches the given name: attr 'android:colorControlNormal'. 
Error:(119, 22) No resource found that matches the given name: attr 'android:colorPrimary'. 
Error:(120, 22) No resource found that matches the given name: attr 'android:colorPrimaryDark'. 
Error:(128, 22) No resource found that matches the given name: attr 'android:windowElevation'. 
Error:(121, 22) No resource found that matches the given name: attr 'android:colorAccent'. 
Error:(125, 22) No resource found that matches the given name: attr 'android:colorButtonNormal'. 
Error:(123, 22) No resource found that matches the given name: attr 'android:colorControlActivated'. 
Error:(124, 22) No resource found that matches the given name: attr 'android:colorControlHighlight'. 
Error:(122, 22) No resource found that matches the given name: attr 'android:colorControlNormal'. 
Error:(119, 22) No resource found that matches the given name: attr 'android:colorPrimary'. 
Error:(120, 22) No resource found that matches the given name: attr 'android:colorPrimaryDark'. 
Error:(128, 22) No resource found that matches the given name: attr 'android:windowElevation'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Borderless'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Borderless.Colored'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Small'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ButtonBar'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.CompoundButton.CheckBox'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.CompoundButton.RadioButton'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ImageButton'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.PopupMenu'. 
Error:(215, 22) No resource found that matches the given name: attr 'android:overlapAnchor'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListPopupWindow'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.PopupMenu'. 
Error:(215, 22) No resource found that matches the given name: attr 'android:overlapAnchor'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.RatingBar'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.SeekBar'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.TextView.SpinnerItem'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Toolbar.Button.Navigation'. 
Error:(121, 22) No resource found that matches the given name: attr 'android:colorAccent'. 
Error:(125, 22) No resource found that matches the given name: attr 'android:colorButtonNormal'. 
Error:(123, 22) No resource found that matches the given name: attr 'android:colorControlActivated'. 
Error:(124, 22) No resource found that matches the given name: attr 'android:colorControlHighlight'. 
Error:(122, 22) No resource found that matches the given name: attr 'android:colorControlNormal'. 
Error:(119, 22) No resource found that matches the given name: attr 'android:colorPrimary'. 
Error:(120, 22) No resource found that matches the given name: attr 'android:colorPrimaryDark'. 

究竟是什麼問題?我想使用appcompat-v7,因爲我實現了導航抽屜。

我能做些什麼來解決這個問題。

編輯:

我編輯gradle這個樣:

compileSdkVersion 21 
buildToolsVersion "21.1.2" 

,但我得到了一些其他錯誤:

\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1\res\values-v23\values-v23.xml 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. 
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'. 

這裏是我的完整gradle這個文件:

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.1.1" 

    defaultConfig { 
     applicationId "de.example.example.app" 
     minSdkVersion 17 
     targetSdkVersion 21 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
    packagingOptions { 
     exclude 'META-INF/DEPENDENCIES.txt' 
     exclude 'META-INF/LICENSE.txt' 
     exclude 'META-INF/NOTICE.txt' 
     exclude 'META-INF/NOTICE' 
     exclude 'META-INF/LICENSE' 
     exclude 'META-INF/DEPENDENCIES' 
     exclude 'META-INF/notice.txt' 
     exclude 'META-INF/license.txt' 
     exclude 'META-INF/dependencies.txt' 
     exclude 'META-INF/LGPL2.1' 
    } 
    compileOptions { 
     sourceCompatibility JavaVersion.VERSION_1_7 
     targetCompatibility JavaVersion.VERSION_1_7 
    } 
    repositories{ 
     mavenCentral() 
    } 

} 

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.android.support:appcompat-v7:23.1.1' 
    compile files('libs/jdom-2.0.6.jar') 
} 
+0

不與兩個依賴問題......我們可以同時添加time..you應該減少你compileSDK版本。 –

回答

1

不使用這兩個庫:V4和V7都

只需切換到這是唯一一個最新的圖書館更好地即:

compile 'com.android.support:appcompat-v7:23.1.1' 

V7包括V4支持庫,所以沒有必要有它在那裏再次

嘗試添加這也

compile 'com.android.support:design:23.0.1' 

你build.gra dle文件可能有類似compleSdkVersion或buildToolsVersion的問題。

因此,當您使用支持和設計V23你必須進行編譯SDK 23

compileSdkVersion 23 
buildToolsVersion '23.1.1' 

,並嘗試籤23.0.1,而不是23.1.1,如果你可能沒有你的SDK更新,試圖利用。

最後在發佈您build.gradle我發現你改變 targetSdkVersion 23,也乾淨,重建項目,嘗試重新啓動如果可能的話。 感謝

+0

哦,我不知道。謝謝你提供信息! – korunos

+0

我擦除支持-V4,但我得到了同樣的錯誤 – korunos

+0

請嘗試我更新的答案,如果有幫助,否則顯示你的build.gradle,也更新SDK – Androider

相關問題