更新 Android SDK 时出错 (org.xml.sax.SAXParseException)

Error updating Android SDK (org.xml.sax.SAXParseException)

我正在尝试使用此命令通过命令行更新 sdk

echo y | android update sdk --no-ui --all --filter build-tools-23.0.2

我遇到了这个错误

 echo y | android update sdk --no-ui --all --filter build-tools-23.0.2
Refresh Sources:
  Fetching https://dl.google.com/android/repository/addons_list-2.xml
  Validate XML
  Parse XML
  Fetched Add-ons List successfully
  Refresh Sources
  Fetching URL: https://dl.google.com/android/repository/repository-11.xml
  Validate XML: https://dl.google.com/android/repository/repository-11.xml
  XML verification failed for https://dl.google.com/android/repository/repository-11.xml.
Line 306:41, Error: org.xml.sax.SAXParseException; lineNumber: 306; columnNumber: 41; cvc-datatype-valid.1.2.1: '11b' is not a valid value for 'integer'.
  Fetching URL: https://dl.google.com/android/repository/addon.xml
  Validate XML: https://dl.google.com/android/repository/addon.xml
  Parse XML:    https://dl.google.com/android/repository/addon.xml
  Fetching URL: https://dl.google.com/android/repository/addon-6.xml
  Validate XML: https://dl.google.com/android/repository/addon-6.xml
  Parse XML:    https://dl.google.com/android/repository/addon-6.xml
  Fetching URL: https://dl-ssl.google.com/glass/gdk/addon.xml
  Validate XML: https://dl-ssl.google.com/glass/gdk/addon.xml
  Parse XML:    https://dl-ssl.google.com/glass/gdk/addon.xml
  Fetching URL: https://dl.google.com/android/repository/extras/intel/addon.xml
  Validate XML: https://dl.google.com/android/repository/extras/intel/addon.xml
  Parse XML:    https://dl.google.com/android/repository/extras/intel/addon.xml
  Fetching URL: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
  Validate XML: https://dl.google.com/android/repository/sys-img/android/sys-img.xml
  Parse XML:    https://dl.google.com/android/repository/sys-img/android/sys-img.xml
  Fetching URL: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Validate XML: https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Parse XML:    https://dl.google.com/android/repository/sys-img/android-wear/sys-img.xml
  Fetching URL: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Validate XML: https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Parse XML:    https://dl.google.com/android/repository/sys-img/android-tv/sys-img.xml
  Fetching URL: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
  Validate XML: https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
  Parse XML:    https://dl.google.com/android/repository/sys-img/google_apis/sys-img.xml
  Fetching URL: https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
  Validate XML: https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
  Parse XML:    https://dl.google.com/android/repository/sys-img/x86/addon-x86.xml
Refresh Sources:
  Fetching URL: https://dl.google.com/android/repository/repository-11.xml
  Validate XML: https://dl.google.com/android/repository/repository-11.xml
  XML verification failed for https://dl.google.com/android/repository/repository-11.xml.
Line 306:41, Error: org.xml.sax.SAXParseException; lineNumber: 306; columnNumber: 41; cvc-datatype-valid.1.2.1: '11b' is not a valid value for 'integer'.
Error: Ignoring unknown package filter 'build-tools-23.0.2'
Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.

问题大概就在这里

Line 306:41, Error: org.xml.sax.SAXParseException; lineNumber: 306; columnNumber: 41; cvc-datatype-valid.1.2.1: '11b' is not a valid value for 'integer'.

这是 运行 在 CircleCI 盒子上,运行 好几天了,到现在为止。

有人知道发生了什么事吗?

提前致谢

有问题的 XML 版本为 11。最新版本似乎是 12,我们的构建也回到了正轨。有那么一刻,Android 团队似乎愚弄了我们。

尝试重建,但还要注意某些 DNS 等可能会导致您无法立即获得更新。