Travis-CI Android SDK license problems

南笙酒味 提交于 2019-11-30 20:44:07

Replace

- ANDROID_BUILD_TOOLS=27.0.2

by

- ANDROID_BUILD_TOOLS=27.0.1

or add:

- echo yes | sdkmanager "build-tools;27.0.1"

to explicitly install the matching version and accept the license as commented here.

Explanation

Since Android Plugin for Gradle 3.0.0 (October 2017)

you no longer need to specify a version for the build tools—the plugin uses the minimum required version by default. So, you can now remove the android.buildToolsVersion property.

You are not specifying a version here, you are explicitly installing version 27.0.2, and Gradle is downloading version 27.0.1 without accepting the license agreement as explained here.

Alternatively add buildToolsVersion 27.0.2 to your app/build.gradle:

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.2"

Note

Seems that it's possible to automatically accept all the licenses, and echo is no longer required:

- yes | sudo sdkmanager --licenses

But I didn't test it, please check this question for further information.

you might still need to copy the licence files to other locations based on your setup.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!