業務で Circle CI をしようして CI を行っていますが、今日あたりから、iOS 上で Android の sdkmanager が動かなくなったので、備忘録的にメモ。 Circle CI で iOS を使用して Android もビルドしている人の参考になるとうれしいです。(そんな人がどんだけ居るよ? って話はおいておこう…)
何が起きたか
==> Satisfying dependencies ==> Downloading https://dl.google.com/android/repository/sdk-tools-darwin-385939 ######################################################################## 100.0% ==> Verifying checksum for Cask android-sdk ==> Installing Cask android-sdk ==> Warning: File /Users/distiller/.android/repositories.cfg could not be loaded ==> Purging files for version 3859397,26.0.2 of Cask android-sdk Error: Command failed to execute! ==> Failed command: /usr/local/Caskroom/android-sdk/3859397,26.0.2/tools/bin/sdkmanager tools platform-tools build-tools;26.0.2 ==> Standard Output of failed command: License android-sdk-license: ---------------------------------------
- Cask 周りで何か失敗している模様なので、しばし状況を観察
- Cask 周りで修正が入って、 brew cask install android sdk は動くけど、その後の sdkmanager を使用して環境を構築するところでタイムアウト。 ログを見る限り、セットアップ後の最初の起動で sdkmanager のライセンス規約の同意プロンプトが出てきて先に進めない模様。
14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction. November 20, 2015 --------------------------------------- Accept? (y/N):
対応策
sdkmanager を使用して環境を構築する前にライセンス規約にあらかじめ同意しておくことによって、環境構築時にプロンプトがでないようにする。 ライセンス規約に同意するためには --licenses スイッチを使用して sdkmanager を起動する。そして、y と回答し続けるため、yes コマンドを使用する
sdkmanager をセットアップ直後に以下のコマンドを実行することにより、ライセンス規約に同意するようにできる。
yes | sdkmanager --licenses
まとめ
- コマンドライン版 sdkmanager をアップデートしたら最初の実行時にライセンス規約の同意プロンプトがでるようになった。
- yes コマンドと sdkmanager --licenses を組み合わせて、セットアップ前に規約に同意するコマンドを実行する必要がある。