【问题标题】:can't update or install any nuget packages in vs 2017无法在 vs 2017 中更新或安装任何 nuget 包
【发布时间】:2018-01-22 14:52:16
【问题描述】:

我刚刚安装了 vs 2017 并想运行我的项目,但我面临很多警告和错误,所以我意识到我应该更新我的 xamarin.android nuget 包,但我不断收到以下错误消息:

Severity    Code    Description Project File    Line    Suppression State Error     Could not install package 'Xamarin.Android.Support.Animated.Vector.Drawable 27.0.2-preview1'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v8.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.           0

修复 vs 无效;删除nuget.config 无效;我什至更改了 .csproj 文件中的版本,但是当我加载项目时,它又回到了 v8.0。

有人可以帮忙吗?

【问题讨论】:

    标签: xamarin nuget visual-studio-2017 updates nuget-package


    【解决方案1】:

    无法在 vs 2017 中更新或安装任何 nuget 包

    正如 Jon 所说,最新的 nuget 包 Xamarin.Android.Support.Animated.Vector.Drawable 27.0.2-preview1,至少需要 MonoAndroid81 才能安装。

    但是,只有 最新的预览版(15.6 预览版 2) 版本的 Visual Studio 包含 Android 8.1 支持。目前,当前发布版本为15.5.4,预览版本为15.6 Preview 2。所以如果你想使用最新版本的nuget包27.0.2-preview1,你需要下载最新版本的Visual Studio15.6 Preview 2并安装Android SDK 8.1。

    如果您不选择切换到 Visual Studio 15.6 Preview 2,则不应将该软件包更新到最新版本,只需使用版本 26.1.0.1

    希望这个答案更清楚。

    【讨论】:

      【解决方案2】:

      这至少需要MonoAndroid81 才能安装。您可以使用当前包含 Android 8.1 支持的 Preview

      https://blog.xamarin.com/xamarin-android-now-double-stuffed-with-oreo-8-1/

      为了将来参考,支持库有一个与其支持的 Android 版本对应的主要版本。在这种情况下支持 v27 = Android 8.1 (API 27)

      【讨论】:

      • 所以我是一个新手,你能解释一下我现在应该做什么吗?我在目标版本下拉框中没有看到任何 android 8.1,我在我的问题中添加了一张照片
      • 那是targetSdkVersion 不是正确的区域。应该是<TargetFramework>developer.xamarin.com/guides/android/application_fundamentals/…
      【解决方案3】:

      当出现错误时,清理您的解决方案并重新构建它。

      还要做一些非常基本的事情,即您要下载的内容在 .Droid 中是“可访问的”,而不仅仅是在 Portable 中。

      如果你不服务,也没有找到解决方案,你必须开始一个新的项目,建议安装最新的SDK等。

      【讨论】:

        猜你喜欢
        • 2021-08-21
        • 2018-11-19
        • 1970-01-01
        • 2017-07-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-03-08
        • 2017-12-21
        相关资源
        最近更新 更多