在 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/