Xamarin 上的一个过时的 'Android SDK Build-tools' 错误

An outdated of 'Android SDK Build-tools' Error on Xamarin

当我创建 Xamarin 项目并构建 Droid 时一切顺利... 但是当我使用控制台添加任何 nuget 包时,例如:

安装包Acr.UserDialogs 或者安装包 Rg.Plugins.Popup 它向我展示了这个 在控制台上:

PM> Install-Package Acr.UserDialogs
Attempting to gather dependencies information for package 'Acr.UserDialogs.6.1.1' with respect to project 'TestAcrDialogs.Droid', targeting 'MonoAndroid,Version=v7.0'
Attempting to resolve dependencies for package 'Acr.UserDialogs.6.1.1' with DependencyBehavior 'Lowest'
Resolving actions to install package 'Acr.UserDialogs.6.1.1'
Resolved actions to install package 'Acr.UserDialogs.6.1.1'
Removed package 'Xamarin.Android.Support.Design.23.0.1.3' from 'packages.config'
Successfully uninstalled 'Xamarin.Android.Support.Design.23.0.1.3' from TestAcrDialogs.Droid
Removed package 'Xamarin.Android.Support.v4.23.0.1.3' from 'packages.config'
Successfully uninstalled 'Xamarin.Android.Support.v4.23.0.1.3' from TestAcrDialogs.Droid
Removed package 'Xamarin.Android.Support.v7.AppCompat.23.0.1.3' from 'packages.config'
Successfully uninstalled 'Xamarin.Android.Support.v7.AppCompat.23.0.1.3' from TestAcrDialogs.Droid
Removed package 'Xamarin.Android.Support.v7.CardView.23.0.1.3' from 'packages.config'
Successfully uninstalled 'Xamarin.Android.Support.v7.CardView.23.0.1.3' from TestAcrDialogs.Droid
Removed package 'Xamarin.Android.Support.v7.MediaRouter.23.0.1.3' from 'packages.config'
Successfully uninstalled 'Xamarin.Android.Support.v7.MediaRouter.23.0.1.3' from TestAcrDialogs.Droid
Removed package 'Xamarin.Forms.2.0.0.6482' from 'packages.config'
Successfully uninstalled 'Xamarin.Forms.2.0.0.6482' from TestAcrDialogs.Droid
Adding package 'Acr.Support.2.1.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Acr.Support.2.1.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Acr.Support.2.1.0' to 'packages.config'
Successfully installed 'Acr.Support 2.1.0' to TestAcrDialogs.Droid
Adding package 'AndHUD.1.2.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'AndHUD.1.2.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'AndHUD.1.2.0' to 'packages.config'
Successfully installed 'AndHUD 1.2.0' to TestAcrDialogs.Droid
Adding package 'Splat.1.6.2' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Splat.1.6.2' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Splat.1.6.2' to 'packages.config'
Successfully installed 'Splat 1.6.2' to TestAcrDialogs.Droid
Adding package 'Xamarin.Android.Support.v4.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.v4.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.v4.23.3.0' to 'packages.config'
Successfully installed 'Xamarin.Android.Support.v4 23.3.0' to TestAcrDialogs.Droid
Adding package 'Xamarin.Android.Support.v7.CardView.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.v7.CardView.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.v7.CardView.23.3.0' to 'packages.config'
Successfully installed 'Xamarin.Android.Support.v7.CardView 23.3.0' to TestAcrDialogs.Droid
Adding package 'Xamarin.Android.Support.v7.RecyclerView.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.v7.RecyclerView.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.v7.RecyclerView.23.3.0' to 'packages.config'
Successfully installed 'Xamarin.Android.Support.v7.RecyclerView 23.3.0' to TestAcrDialogs.Droid
Adding package 'Xamarin.Android.Support.Vector.Drawable.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.Vector.Drawable.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.Vector.Drawable.23.3.0' to 'packages.config'
Successfully installed 'Xamarin.Android.Support.Vector.Drawable 23.3.0' to TestAcrDialogs.Droid
Adding package 'Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.Animated.Vector.Drawable.23.3.0' to 'packages.config'
Successfully installed 'Xamarin.Android.Support.Animated.Vector.Drawable 23.3.0' to TestAcrDialogs.Droid
Adding package 'Xamarin.Android.Support.v7.AppCompat.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.v7.AppCompat.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.v7.AppCompat.23.3.0' to 'packages.config'
Successfully installed 'Xamarin.Android.Support.v7.AppCompat 23.3.0' to TestAcrDialogs.Droid
Adding package 'Xamarin.Android.Support.Design.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.Design.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.Design.23.3.0' to 'packages.config'
Successfully installed 'Xamarin.Android.Support.Design 23.3.0' to TestAcrDialogs.Droid
Adding package 'Acr.UserDialogs.6.1.1' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Acr.UserDialogs.6.1.1' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Acr.UserDialogs.6.1.1' to 'packages.config'
Successfully installed 'Acr.UserDialogs 6.1.1' to TestAcrDialogs.Droid
Adding package 'Xamarin.Android.Support.v7.MediaRouter.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.v7.MediaRouter.23.3.0' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Android.Support.v7.MediaRouter.23.3.0' to 'packages.config'
Successfully installed 'Xamarin.Android.Support.v7.MediaRouter 23.3.0' to TestAcrDialogs.Droid
Adding package 'Xamarin.Forms.2.2.0.31' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Forms.2.2.0.31' to folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Added package 'Xamarin.Forms.2.2.0.31' to 'packages.config'
Successfully installed 'Xamarin.Forms 2.2.0.31' to TestAcrDialogs.Droid
Removing package 'Xamarin.Android.Support.Design.23.0.1.3' from folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Removed package 'Xamarin.Android.Support.Design.23.0.1.3' from folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Removing package 'Xamarin.Android.Support.v4.23.0.1.3' from folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Removed package 'Xamarin.Android.Support.v4.23.0.1.3' from folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Removing package 'Xamarin.Android.Support.v7.AppCompat.23.0.1.3' from folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Removed package 'Xamarin.Android.Support.v7.AppCompat.23.0.1.3' from folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Removing package 'Xamarin.Android.Support.v7.CardView.23.0.1.3' from folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Removed package 'Xamarin.Android.Support.v7.CardView.23.0.1.3' from folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Removing package 'Xamarin.Android.Support.v7.MediaRouter.23.0.1.3' from folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'
Removed package 'Xamarin.Android.Support.v7.MediaRouter.23.0.1.3' from folder 'C:\Programming\C#\Cross-Platform Xamarin\New\TestAcrDialogs\packages'

之后我在构建 Droid 项目时遇到此错误:

An outdated of 'Android SDK Build-tools' is in use which this version of Android Support Library does not support.  You must uninstall any 'Android SDK Build-tools' versions older than 23.0.0 from the 'Tools' section in your 'Android SDK Manager'      

但是我没有任何旧的构建工具...

您必须打开 Android SDK 管理器并检查您使用的工具版本。如果您使用 Visual studio,您甚至可以使用 Android 工具栏上的按钮从 IDE 打开它(查看 - 工具栏 - Android)。打开后,您将能够看到您安装了哪些版本的 Android 构建工具,以及它们是否与您正在使用的库所需的版本相匹配。

我转到 SDK 文件夹下的 Build-tools,我有 "android-6" 文件夹,它包含 Build-tools ver 23.0.3 但是因为它的文件夹名称, Xamarin 认为这是一个旧版本。

我删除了它然后一切正常...

所以文件夹名称对 Xamarin 很重要。