android - 无法在构建机器上更新 android sdk

标签 android jenkins

在 Jenkins 上运行的 CI 构建中,我有一个步骤,如果机器上不存在 sdk,则下载 sdk,然后它将下载并更新所需的所有内容。我的构建在我的 macbook 和新的 vagrant ubuntu 机器上运行,但是当我在 Jenkins 主机上运行它时,它总是失败。

我有一个 shell 脚本,它应该下载我需要的所有必要的 Android 工具。

expect -c 'set timeout -1;
spawn android update sdk --all --filter build-tools-20.0.0,platform-tools,android-20,extra-android-support,extra-google-m2repository,extra-android-m2repository --no-ui;
expect {
    "Do you accept the license" {
        exp_send "y\r"
        exp_continue
    }
    eof
}

catch wait result
exit [lindex \$result 3]'

这只是一个自动接受许可证的期望脚本。有问题的行是

android update sdk --all --filter build-tools-20.0.0,platform-tools,android-20,extra-android-support,extra-google-m2repository,extra-android-m2repository --no-ui

构建机器上的输出是...

Error: Ignoring unknown package filter 'build-tools-20.0.0'
Error: Ignoring unknown package filter 'android-20'
Error: Ignoring unknown package filter 'extra-google-m2repository'
Error: Ignoring unknown package filter 'extra-android-m2repository'

这些 ID 存在于 sdk 中,所以我有点迷失,有什么想法吗?

最佳答案

根据 Xavier Ducrochet 的评论在Google+ Post上.

Older version (<23) use a different XML schema for the component listing and therefore hit a different URL to get the component list. This list does not include API 20.

Upgrade the tools to 23, and then run your script again it should work.

我只需要将工具升级到版本 23,一切都会按预期运行。

关于android - 无法在构建机器上更新 android sdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24657594/

相关文章:

android - 在我的应用程序中出现构建错误

android - 在 Android 的仪表板中需要帮助

c++ - 无法运行 Jenkins C++ 工件

jenkins - 读取 jenkins groovy 脚本中的配置文件以获取构建参数

jenkins - Jenkins 如何更新构建作业的天气报告?

android - UiAutomator 2.0 命令行测试

android - 在 Dagger 2.15 中,我是否需要在每个 Activity 上添加注入(inject)行?

android - Listview 滚动 Android 上的问题

java - Cloudbees 构建错误

Jenkins:一个严重分支的构建工作链