添加CardView组件后无法构建

时间:2016-07-19 14:41:29

标签: android visual-studio xamarin xamarin.android

我已将CardView组件添加到我的解决方案中并产生了这些错误。在错误的下半部分,它指的是\Resources\values\style.xml此文件中存在缺失值。

我试过了:

  • \AppData\Local\Xamarin\zips
  • 删除下载的拉链
  • 删除\AppData\Local\Xamarin
  • 上的所有各种支持文件
  • 清洗
  • 重启VS
  • 将编译版本从6.0更改为5.1
  • 删除组件并重新添加
  • 从NuGet中删除组件并添加Xamarin.Android.Support.v7.CardView

我需要做什么?

\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(66): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'Animation.AppCompat.Dialog'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(80): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Display1'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(83): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Caption'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(84): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Caption'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(87): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Caption'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(90): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Caption'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(97): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Button'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(100): error APT0000: 
No resource found that matches the given name: attr 'textAllCaps'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(102): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(105): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Dialog'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(110): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(113): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(119): error APT0000: 
No resource found that matches the given name: attr 'windowActionBar'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(120): error APT0000: 
No resource found that matches the given name: attr 'windowNoTitle'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(123): error APT0000: 
No resource found that matches the given name: attr 'windowActionBar'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(124): error APT0000: 
No resource found that matches the given name: attr 'windowNoTitle'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(127): error APT0000: 
No resource found that matches the given name: attr 'elevation'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(145): error APT0000: 
No resource found that matches the given name: attr 'backgroundTint'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(147): error APT0000: 
No resource found that matches the given name: attr 'elevation'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(153): error APT0000: 
No resource found that matches the given name: attr 'elevation'.
\obj\Debug\resourcecache\5F2...97F5\res\values\values.xml(168): error APT0000: 
No resource found that matches the given name: attr 'elevation'.
\Resources\values\style.xml(2): error APT0000: Error retrieving parent for item: 
No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.
\Resources\values\style.xml(2): error APT0000: 
No resource found that matches the given name: attr 'actionBarPopupTheme'.
\Resources\values\style.xml(2): error APT0000: 
No resource found that matches the given name: attr 'actionBarStyle'.
\Resources\values\style.xml(2): error APT0000: 
No resource found that matches the given name: attr 'actionBarTheme'.
\Resources\values\style.xml(2): error APT0000: 
No resource found that matches the given name: attr 'colorAccent'.
\Resources\values\style.xml(2): error APT0000: 
No resource found that matches the given name: attr 'colorPrimary'.
\Resources\values\style.xml(2): error APT0000: 
No resource found that matches the given name: attr 'colorPrimaryDark'.
\Resources\values\style.xml(2): error APT0000: 
No resource found that matches the given name: attr 'windowActionModeOverlay'.
\Resources\values\style.xml(2): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ActionBar.Solid'.
\Resources\values\style.xml(2): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'.
\Resources\values\style.xml(2): error APT0000: 
No resource found that matches the given name: attr 'colorAccent'.
\Resources\values\style.xml(2): error APT0000: 
No resource found that matches the given name: attr 'colorPrimary'.
\Resources\values\style.xml(2): error APT0000: 
No resource found that matches the given name: attr 'colorPrimaryDark'.
\Resources\values\style.xml(2): error APT0000: 
No resource found that matches the given name: attr 'colorAccent'.
\Resources\values\style.xml(2): error APT0000: 
Error retrieving parent for item: No resource found that matches the given name 'Base.Widget.AppCompat.Button.Borderless'.

1 个答案:

答案 0 :(得分:0)

检查您的依赖项版本。全部放在同一个版本中。 喜欢: public string FormatString(string input) { input = Regex.Replace(input, "~b~", "<unicode for blue>", RegexOptions.IgnoreCase); input = Regex.Replace(input, "~r~", "<Unicode for reset>", RegexOptions.IgnoreCase); return input; }

compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.android.support:percent:23.3.0'
在此之后,清理并构建。