Android 升级到Visual Studio 15.5.1和Xamarin 2.5时出现的问题

Android 升级到Visual Studio 15.5.1和Xamarin 2.5时出现的问题,android,xamarin,visual-studio-2017,Android,Xamarin,Visual Studio 2017,我一直在尝试使用Nuget将Xamarin项目更新到Xamarin的更高版本,但由于缺少组件而不断失败,Nuget无法安装这些组件,因为缺少其他组件 所以我想,既然我需要进行一次重大的升级,我将从一个新的、最新的Xamarin项目开始,并在其中迁移代码并对其进行更改 除了我在一个完全空的新Xamarin项目中遇到错误,我不知道如何修复它们 我已经修了好几次了,但都不走运 错误与生成的Android styles.xml文件有关。这与旧项目中的相同,但没有给出错误 <?xml vers

我一直在尝试使用Nuget将Xamarin项目更新到Xamarin的更高版本,但由于缺少组件而不断失败,Nuget无法安装这些组件,因为缺少其他组件

所以我想,既然我需要进行一次重大的升级,我将从一个新的、最新的Xamarin项目开始,并在其中迁移代码并对其进行更改

除了我在一个完全空的新Xamarin项目中遇到错误,我不知道如何修复它们

我已经修了好几次了,但都不走运

错误与生成的Android styles.xml文件有关。这与旧项目中的相同,但没有给出错误

   <?xml version="1.0" encoding="utf-8" ?>
   <resources>

   <style name="MainTheme" parent="MainTheme.Base">
   </style>
   <!-- Base theme applied no matter what API -->
   <style name="MainTheme.Base"        parent="Theme.AppCompat.Light.DarkActionBar">
     <!--If you are using revision 22.1 please use just windowNoTitle.      Without android:-->
     <item name="windowNoTitle">true</item>
     <!--We will be using the toolbar so no need to show ActionBar-->
     <item name="windowActionBar">false</item>
     <!-- Set theme colors from      http://www.google.com/design/spec/style/color.html#color-color-palette -->
     <!-- colorPrimary is used for the default action bar background -->
     <item name="colorPrimary">#2196F3</item>
     <!-- colorPrimaryDark is used for the status bar -->
     <item name="colorPrimaryDark">#1976D2</item>
     <!-- colorAccent is used as the default value for colorControlActivated
     which is used to tint widgets -->
     <item name="colorAccent">#FF4081</item>
     <!-- You can also set colorControlNormal, colorControlActivated
     colorControlHighlight and colorSwitchThumbNormal. -->
     <item name="windowActionModeOverlay">true</item>

     <item name="android:datePickerDialogTheme">@style/AppCompatDialogStyle</item>
   </style>

   <style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
     <item name="colorAccent">#FF4081</item>
   </style>
 </resources>

对于任何有此问题的人,我发现了以下文章:

不知何故,这些设置在VisualStudio选项中被取消选中,这意味着Nuget还原没有发生

启用Nuget restore后,它会自动下载丢失的组件,错误也就消失了

  3: error: Error: No resource found that matches the given name: attr 'colorAccent'.   
  1: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
  2: error: Error: No resource found that matches the given name: attr 'colorAccent'.