Visual studio VS 2019更新后尝试构建Xamarin.Android时出错

Visual studio VS 2019更新后尝试构建Xamarin.Android时出错,visual-studio,xamarin,xamarin.forms,xamarin.android,visual-studio-2019,Visual Studio,Xamarin,Xamarin.forms,Xamarin.android,Visual Studio 2019,我有一个Xamarin.Forms应用程序,过去可以正常工作,但从Visual Studio 2017更新到2019后,我在尝试构建解决方案时在Xamarin.Android中遇到了一个异常。我的代码中没有任何更改。我得到的例外是: Error The "GenerateResourceDesigner" task failed unexpectedly. System.Xml.XmlException: '.', hexadecimal value 0x00, is an inva

我有一个Xamarin.Forms应用程序,过去可以正常工作,但从Visual Studio 2017更新到2019后,我在尝试构建解决方案时在Xamarin.Android中遇到了一个异常。我的代码中没有任何更改。我得到的例外是:

   Error The "GenerateResourceDesigner" task failed unexpectedly.
   System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 1, position 1.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
   at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[] data, Int32 length, Int32 invCharPos)
   at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()
   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
   at System.Xml.Linq.XDocument.Load(String uri, LoadOptions options)
   at Xamarin.Android.Tasks.ManagedResourceParser.Parse(String resourceDirectory, IEnumerable`1 additionalResourceDirectories, Boolean isApp, Dictionary`2 resourceMap)
   at Xamarin.Android.Tasks.GenerateResourceDesigner.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() EventApp                
错误“GenerateResourceDesigner”任务意外失败。
System.Xml.XmlException:“.”十六进制值0x00是无效字符。第1行,位置1。
位于System.Xml.XmlTextReaderImpl.Throw(异常e)
位于System.Xml.XmlTextReaderImpl.Throw(字符串res,字符串[]args)
位于System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Char[]数据,Int32长度,Int32 invCharPos)
位于System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace()处
位于System.Xml.XmlTextReaderImpl.ParseDocumentContent()处
位于System.Xml.XmlTextReaderImpl.Read()处
位于System.Xml.Linq.XDocument.Load(XmlReader阅读器,LoadOptions)
位于System.Xml.Linq.XDocument.Load(字符串uri,LoadOptions)
位于Xamarin.Android.Tasks.ManagedResourceParser.Parse(字符串resourceDirectory、IEnumerable`1 AdditionalResourceDirectory、布尔isApp、Dictionary`2 resourceMap)
在Xamarin.Android.Tasks.GenerateResourceDesigner.Execute()中
位于Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ItaskeExecutionHost.Execute()
在Microsoft.Build.BackEnd.TaskBuilder.d_u26.MoveNext()EventApp中
我已经尝试了一切可能的方法,比如卸载和重新安装Visual Studio 2019。清除binobj文件夹,但似乎没有任何效果


有人知道如何解决此问题吗?

您是否更新了所有NuGet软件包?检查所有依赖项?更新到VS 16.3.5?虽然没有得到同样的错误,但我在使用最新的VS和XF以及谷歌广告时遇到了问题。另一个对我没有帮助,但对其他人有帮助的建议是添加

android:targetSdkVersion="28"

到使用权限标记。网络核心版本设置是否正确?

我的问题已解决。这是Visual studio 2019的一些问题。我在VS安装程序中点击修复visual studio,花了一些时间,然后我的问题就解决了。无论如何,谢谢您的帮助:)

是的,所有Nugest软件包都已更新。依赖关系得到解决。VS更新为16.3.5。目标SdkVersion为“28”。一切都很好,在其他电脑上工作,但不是我的@斯蒂芬·林克:网络核心版2.0怎么样?2.1? 你的代码中有空值吗?请参阅1月4日的评论-用干净的副本替换Properties.xml。