Xamarin - 如何更新 Mono.Android 版本以解决依赖关系? [英] Xamarin - How to update Mono.Android version to resolve dependencies?

查看:18
本文介绍了Xamarin - 如何更新 Mono.Android 版本以解决依赖关系?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试安装一个 nuget 包 (Xamarin.Firebase.Firestore),它需要更新版本的 Xamarin.GooglePlayServices.Basement(60.1142.0,我有 42.1021.1),这反过来又要求我更新xamarin.android.support 包.当我尝试更新这些时,出现此错误包 Xamarin.Android.Support.Design 27.0.2 与 monoandroid80 (MonoAndroid,Version=v8.0) 不兼容.包 Xamarin.Android.Support.Design 27.0.2 支持:monoandroid81 (MonoAndroid,Version=v8.1)"

我已经尝试将我的目标 android 版本更改为 8.1,我还更新了我的 SDK 以及构建工具.我正在运行 Visual Studio 15.6.1.作为最后的努力,我尝试删除 Mono.Android V8.0 引用,然后添加对 V8.1 的新引用,但每当我这样做时,Visual Studio 最终都会添加指向 V8.0 的路径的引用,即使我添加的参考明确指向 V8.1.

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

解决方案

尝试将我的目标 android 版本更改为 8.1

您需要更改用于编译您的android应用程序的Target Framework,而不是Target Android version(但假设您将这两个设置为相同,阅读下面的了解 Android API 级别链接.

Windows 版 Visual Studio:

Mac 版 Visual Studio:

<块引用>

目标框架 - 指定在构建应用程序时使用的框架.此 API 级别由 Xamarin.Android 在编译时使用.

最低 Android 版本 - 指定您希望您的应用支持的最旧 Android 版本.Android 在运行时使用此 API 级别.

目标 Android 版本 – 指定您的应用要运行的 Android 版本.Android 在运行时使用此 API 级别.

  • Mac 版 Visual Studio:

    I'm trying to install a nuget package (Xamarin.Firebase.Firestore) which requires a newer version of Xamarin.GooglePlayServices.Basement (60.1142.0, I have 42.1021.1), which in turn requires me to update the xamarin.android.support packages. When I try to update those, I get this error "Package Xamarin.Android.Support.Design 27.0.2 is not compatible with monoandroid80 (MonoAndroid,Version=v8.0). Package Xamarin.Android.Support.Design 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1)"

    I've tried changing my target android version to 8.1, I've also updated my SDK as well as the build tools. I'm running Visual Studio 15.6.1. As a last ditch effort, I tried deleting the Mono.Android V8.0 reference and then adding a new reference to V8.1, but whenever I do so, Visual studio just ends up adding the reference with the path pointing to V8.0, even though the reference I added was clearly pointing to V8.1.

    Anyone has a clue how to resolve this issue?

    解决方案

    tried changing my target android version to 8.1

    You need to change the Target Framework that is used to compile your android application, not the Target Android version (but assumably you would set these two to the same, read the Understanding Android API Levels link below.

    Visual Studio for Windows:

    Visual Studio for Mac:

    Target Framework – Specifies which framework to use in building your application. This API level is used at compile time by Xamarin.Android.

    Minimum Android Version – Specifies the oldest Android version that you want your app to support. This API level is used at run time by Android.

    Target Android Version – Specifies the version of Android that your app is intended to run on. This API level is used at run time by Android.

    Manifest Entries:

    Visual Studio for Windows:

    Visual Studio for Mac:

    这篇关于Xamarin - 如何更新 Mono.Android 版本以解决依赖关系?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆