首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何修复Xamarin窗体空白项目生成错误

如何修复Xamarin窗体空白项目生成错误
EN

Stack Overflow用户
提问于 2019-07-01 06:33:53
回答 1查看 991关注 0票数 0

我在新的Xamarin空白项目中有一些错误。

我试过:

  • 重开VS
  • 更新所有Nuget包
  • 重新安装VS

projet第一次构建失败,有以下错误:

代码语言:javascript
复制
Severity    Code    Description Project File    Line    Suppression State
Error   Can not resolve reference: Xamarin.Android.Support.CustomTabs, referenced by Xamarin.Essentials. Please add a NuGet package or assembly reference for Xamarin.Android.Support.CustomTabs, or remove the reference to Xamarin.Essentials. TestAPP.Android

Severity    Code    Description Project File    Line    Suppression State
Error   Can not resolve reference: Xamarin.Android.Support.Compat, referenced by Xamarin.Android.Support.DrawerLayout. Please add a NuGet package or assembly reference for Xamarin.Android.Support.Compat, or remove the reference to Xamarin.Android.Support.DrawerLayout.    TestAPP.Android

Severity    Code    Description Project File    Line    Suppression State
Error   The “Xamarin.Android.Support.BuildTasks.VerifyVersionsTask” task could not be loaded from the assembly…nuget\packages\xamarin.android.support.annotations\28.0.0.1\build\monoandroid90\Xamarin.Android.Support.BuildTasks.dll. Could not load file or assembly ‘…nuget\packages\xamarin.android.support.annotations\28.0.0.1\build\monoandroid90\Xamarin.Android.Support.BuildTasks.dll’ or one of its dependencies. The system cannot find the file specified. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.   TestAPP.Android

Severity    Code    Description Project File    Line    Suppression State
Error   Can not resolve reference: Xamarin.Android.Support.Compat, referenced by Xamarin.Android.Support.CoordinaterLayout. Please add a NuGet package or assembly reference for Xamarin.Android.Support.Compat, or remove the reference to Xamarin.Android.Support.CoordinaterLayout.  TestAPP.Android

Severity    Code    Description Project File    Line    Suppression State
Error   Can not resolve reference: Xamarin.Android.Support.Compat, referenced by Xamarin.Android.Support.SlidingPaneLayout. Please add a NuGet package or assembly reference for Xamarin.Android.Support.Compat, or remove the reference to Xamarin.Android.Support.SlidingPaneLayout.  TestAPP.Android

Severity    Code    Description Project File    Line    Suppression State
Error   Can not resolve reference: Xamarin.Android.Arch.Lifecycle.Common, referenced by Xamarin.Android.Arch.Lifecycle.LiveData.Core. Please add a NuGet package or assembly reference for Xamarin.Android.Arch.Lifecycle.Common, or remove the reference to Xamarin.Android.Arch.Lifecycle.LiveData.Core.  TestAPP.Android

Severity    Code    Description Project File    Line    Suppression State
Error   Can not resolve reference: Xamarin.Android.Arch.Core.Common, referenced by Xamarin.Android.Arch.Lifecycle.LiveData. Please add a NuGet package or assembly reference for Xamarin.Android.Arch.Core.Common, or remove the reference to Xamarin.Android.Arch.Lifecycle.LiveData.  TestAPP.Android

Severity    Code    Description Project File    Line    Suppression State
Error   Can not resolve reference: Xamarin.Android.Support.Compat, referenced by Xamarin.Android.Support.SwipeRefreshLayout. Please add a NuGet package or assembly reference for Xamarin.Android.Support.Compat, or remove the reference to Xamarin.Android.Support.SwipeRefreshLayout.    TestAPP.Android

Severity    Code    Description Project File    Line    Suppression State
Error   Can not resolve reference: Xamarin.Android.Support.Compat, referenced by Xamarin.Android.Support.CustomView. Please add a NuGet package or assembly reference for Xamarin.Android.Support.Compat, or remove the reference to Xamarin.Android.Support.CustomView.    TestAPP.Android

Severity    Code    Description Project File    Line    Suppression State
Error   Can not resolve reference: Xamarin.Android.Support.v7.RecyclerView, referenced by Xamarin.Forms.Platform.Android. Please add a NuGet package or assembly reference for Xamarin.Android.Support.v7.RecyclerView, or remove the reference to Xamarin.Forms.Platform.Android.  TestAPP.Android
EN

回答 1

Stack Overflow用户

发布于 2019-07-01 06:54:14

请试以下几点

  1. 跨Xamarin.Forms解决方案中的所有项目升级所有Xamarin.Forms和Xamarin.Essentials nuget包
  2. 关闭
  3. 进入您的Android项目的.csproj文件,并将所有Xamarin.Android支持nuget包(可能类似于v27.x.x.x)的版本号更改为最新版本,即28.0.0.1(只需做一个替换所有更新到该版本)。
  4. 从每个项目文件夹中删除bin和obj文件夹
  5. 在Visual中重新打开解决方案,进行清理并重新生成
票数 -1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56830944

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档