无法打开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

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

问题描述

我正在使用Visual Studio,无法在Xamarin Android Designer中打开布局文件.尝试时出现此错误:

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?

推荐答案

我最近遇到了The installed Android SDK is too old. Version 25.1.3 or newer is required. Please update to the latest version.,发现我必须分两个阶段更新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.我安装了工具,平台工具和构建工具的可用更新,然后退出并重新打开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,博士;

tl, dr;

  1. 安装64位JDK 1.8
  2. 更新Android SDK工具,平台工具和构建工具.关闭SDK Manager,如果警告中所要求的版本不是警告,请重复此步骤 如图所示.如果出现警告!您可能需要退出Visual Studio. 文件夹无法移动"
  3. 确保Visual Studio中的Android设置指向 正确的位置:工具>选项> Xamarin> Android设置
  4. 保持Xamarin安装最新!工具>选项> Xamarin>其他>立即检查"
  1. Install 64-bit JDK 1.8
  2. Update Android SDK Tools, Platform-tools, and Build-tools. Close SDK Manager and repeat if the version required in the warning isn’t shown. You may need to exit Visual Studio if you get "Warning! A folder failed to be moved"
  3. Make sure the Android settings in Visual Studio are pointing to the right locations: Tools > Options > Xamarin > Android Settings
  4. Keep the Xamarin installation up to date! Tools > Options > Xamarin > Other > "Check Now"

不确定那是一次性的,所以我决定在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. 卸载构建工具v23.0.3,关闭SDK管理器
  5. 关闭&重新打开布局文件,得到消息太旧"消息
  6. 打开SDK Manager,更新到Build-tools v25,卸载Build-tools v24.0.3
  7. 关闭SDK管理器&布局文件
  8. 重新打开打开的布局文件,得到相同的消息
  9. 打开SDK Manager,更新为Platform-tools v25
  10. 关闭SDK Manager&布局文件
  11. 重新打开布局文件,仍然太旧
  12. 打开SDK Manager,将SDK工具从v25.1.2更新到v25.2.2
  1. Download Xamarin for Windows
  2. Update to Xamarin latest Stable: Tools > Options > Xamarin > Other > "Check Now"
  3. Open Android SDK Manager, update Build-tools from v23.0.3 to v24.0.3
  4. Uninstall Build-tools v23.0.3, close SDK Manager
  5. Close & reopen layout file, get "too old" message
  6. Open SDK Manager, update to Build-tools v25, uninstall Build-tools v24.0.3
  7. Close SDK manager & layout file
  8. Reopen open layout file, get same message
  9. Open SDK Manager, update to Platform-tools v25
  10. Close SDK Manager & layout file
  11. Reopen layout file, still too old
  12. Open SDK Manager, update SDK Tools from v25.1.2 to v25.2.2

在这里,我也收到了

Here, I got the same warning mentioned in another SO post

继续:

  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太旧"消息中的提示之外,还可以通过工具">"Android">"Android SDK Manager"或"SDK Manager"工具栏图标打开Android 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.

我的个人做法是仅安装一个版本的构建工具,以帮助最大程度地减少潜在的冲突或上游问题,例如.

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开发的,则无论是否使用Xamarin,我们都需要这些工具来进行仿真器,调试,APK签名以及访问最新平台功​​能之类的操作.

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天全站免登陆