无法打开 Xamarin Android .axml 文件:安装的 Android SDK 太旧.需要 25.1.3 或更高版本.请更新到最新版本 [英] Can’t open Xamarin Android .axml file: The installed Android SDK is too old. Version 25.1.3 or newer is required. Please update to the latest version

查看:29
本文介绍了无法打开 Xamarin Android .axml 文件:安装的 Android SDK 太旧.需要 25.1.3 或更高版本.请更新到最新版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是 Visual Studio,但无法在 Xamarin Android 设计器中打开布局文件.我尝试时收到此错误:

I'm using Visual Studio and am unable to open layout files in the Xamarin Android Designer. I get this error when I try:

出了点问题
安装的 Android SDK 太旧.需要 25.1.3 或更高版本.请更新到最新版本.

Something went wrong
The installed Android SDK is too old. Version 25.1.3 or newer is required. Please update to the latest version.

我已经更新了 Xamarin,但仍然卡住了.如何解决这个问题?

I’ve already updated Xamarin, and am still stuck. How can this be fixed?

推荐答案

我最近遇到安装的Android SDK太旧了.需要 25.1.3 或更高版本.请更新到最新版本. 我自己发现我必须分两个阶段更新 Android SDK 才能正常工作.

I recently ran into The installed Android SDK is too old. Version 25.1.3 or newer is required. Please update to the latest version. myself and found that I had to update the Android SDK in two stages to get things working.

正如其他用户所提到的,只显示了 24.x.x 版的更新,而找不到 25.x.x 版的更新.我安装了 Tools、Platform-Tools 和 Build-Tools 的可用更新,然后退出并重新打开 Android SDK Manager.这有效;现在可以安装 25.x.x 版.

As other users have mentioned, only updates for version 24.x.x were showing, while version 25.x.x was nowhere to be found. I installed the available updates for Tools, Platform-Tools, and Build-Tools, then exited and reopened the Android SDK Manager. This worked; version 25.x.x was now available for installation.

tl,博士;

  1. 安装 64 位 JDK 1.8
  2. 更新 Android SDK 工具、平台工具和构建工具.如果警告中所需的版本不是,请关闭 SDK Manager 并重复显示.如果您收到警告!A文件夹移动失败"
  3. 确保 Visual Studio 中的 Android 设置指向正确的位置:工具 > 选项 > Xamarin > Android 设置
  4. 使 Xamarin 安装保持最新!工具 > 选项 > Xamarin > 其他 > 立即检查"

不确定这是否是一次性的,我决定在 Windows 10 上使用 Visual Studio 2015 进行全新的 Xamarin 安装.以下是我重现该问题并重新开始处理布局文件的方法.这很长,这些步骤可能可以简化,但我想清楚地说明我做了什么.

Unsure if that was a one-off, I decided to do a fresh Xamarin installation with Visual Studio 2015 on Windows 10. Here is how I reproduced the issue and got back to working with layout files. This is long and these steps can probably be streamlined, but I wanted to give a clear picture of what I did.

这是我的分步过程:

  1. 下载适用于 Windows 的 Xamarin
  2. 更新到 Xamarin 最新稳定版:工具 > 选项 > Xamarin > 其他 >立即检查"
  3. 打开 Android SDK Manager,将 Build-tools 从 v23.0.3 更新到 v24.0.3
  4. 卸载 Build-tools v23.0.3,关闭 SDK Manager
  5. 关闭&重新打开布局文件,收到太旧"消息
  6. 打开 SDK Manager,更新到 Build-tools v25,卸载 Build-tools v24.0.3
  7. 关闭 SDK 管理器 &布局文件
  8. 重新打开布局文件,得到同样的信息
  9. 打开 SDK 管理器,更新到 Platform-tools v25
  10. 关闭 SDK Manager &布局文件
  11. 重新打开布局文件,还是太旧了
  12. 打开 SDK Manager,将 SDK Tools 从 v25.1.2 更新到 v25.2.2

在这里,我收到了

继续:

  1. 退出Visual Studio;解除警告,过程继续正常
  2. 警告又回来了;再次解雇允许过程完成
  3. 关闭 SDK Manager,打开 Visual Studio,加载 Android 项目,打开和布局文件.成功!我可以再次查看布局文件.

为了尽量减少潜在的障碍/混淆,我还想提一些额外的事情:

There are a few additional things I’d like to mention to minimize potential snags/confusion:

  • Android Studio 不是必需的.除了SDK is too old"信息中的提示外,Android SDK Manager 可以通过工具 > Android > Android SDK Manager 或 SDK Manager 工具栏图标打开.

  • Android Studio is not required. In addition to the prompt in the "SDK is too old" message, the Android SDK Manager can be opened via Tools > Android > Android SDK Manager or the SDK Manager toolbar icon.

我个人的做法是只安装一个版本的 Build-tools 以帮助最大程度地减少潜在的冲突或上游问题,例如 在使用版本 24"时出现的一对.

My personal practice is to have only one version of the Build-tools installed to help minimize potential conflict or upstream issues, such as a couple that came up while using "version 24".

我还想指出,Android SDK 更新并非特定于 Xamarin.如果我们正在为 Android 开发,我们需要这些工具来执行模拟器、调试、签署 APK 和访问最新的平台功能等操作,无论是否使用 Xamarin.

I’d also like to note that Android SDK updates are not specific to Xamarin. If we’re developing for Android, we need these tools for things like emulators, debugging, signing APKs, and accessing the newest platform features, whether using Xamarin or not.

如果好奇,可以在此处找到更多详细信息:
- Android Studio 命令行工具文档
- 什么是Android SDK 构建工具、平台工具和工具?应该使用哪个版本?

For the curious, more details can be found here:
- Android Studio Command Line Tools doc
- What are the Android SDK build-tools, platform-tools and tools? And which version should be used?

这篇关于无法打开 Xamarin Android .axml 文件:安装的 Android SDK 太旧.需要 25.1.3 或更高版本.请更新到最新版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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