由于某些许可证尚未接受,因此无法安装以下Android SDK软件包 [英] Failed to install the following Android SDK packages as some licences have not been accepted

查看:1180
本文介绍了由于某些许可证尚未接受,因此无法安装以下Android SDK软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的Android项目中集成一个持续集成系统,我发现CodeShip是一个很好的选择,因此我创建并配置了一个项目,以使用以下脚本来编译我的Android应用程序:

I need to integrate a continuous integration system in my Android project, I have seen that CodeShip is a good alternative so I have created and configured a project to compile my Android application using the following script:

# Install java 8
jdk_switcher home oraclejdk8
jdk_switcher use oraclejdk8
export JAVA8_HOME=/usr/lib/jvm/java-8-oracle
export BUILD_TOOLS_VERSION=23.0.3
export ANDROID_SDK=24
export ANDROID_SDK_REV=24.4.1
#
# Install android sdk
export SDK_TAR=android-sdk_r$ANDROID_SDK_REV-linux
wget "http://dl.google.com/android/$SDK_TAR.tgz"
tar xvzf "$SDK_TAR.tgz"
rm "$SDK_TAR.tgz"
export ANDROID_HOME=$PWD/android-sdk-linux
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
(while sleep 3; do echo "y"; done) | $ANDROID_HOME/tools/android update sdk -u
echo "y" | android update sdk --no-ui --all --filter tools,platform-tools,build-tools-$BUILD_TOOLS_VERSION > step1.log
echo "y" | android update sdk --no-ui --all --filter extra-android-m2repository,extra-android-support,extra-google-analytics_sdk_v2,extra-google-google_play_services_froyo,extra-google-google_play_services,extra-google-m2repository > step2.log
echo "y" | android update sdk --no-ui --all --filter android-$ANDROID_SDK,sysimg-$ANDROID_SDK,addon-google_apis-google-$ANDROID_SDK > step3.log
#
# Setup gradle
touch local.properties
echo "sdk.dir=$ANDROID_HOME" >> local.properties
chmod u+x ./gradlew
#
# Build
./gradlew assembleDevelop

当我推送存储库并启动编译时,在编译过程中会发生以下错误:

When I push my repository and launch the compilation the following error occurs during compilation:

Warning: License for package Android SDK Build-Tools 27.0.3 not accepted.
FAILURE: Build failed with an exception.
 occurred configuring project ':app'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;27.0.3 Android SDK Build-Tools 27.0.3
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

Using Android SDK: /home/rof/clone/android-sdk-linux

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 20s

原则上,行 echo and | android update sdk --no-ui --all-过滤工具,平台工具,构建工具-$ BUILD_TOOLS_VERSION> step1.log 应该可以解决此问题。有人可以告诉我脚本中缺少什么才能成功执行编译。

In principle the lines echo "and" | android update sdk --no-ui --all - filter tools, platform-tools, build-tools- $ BUILD_TOOLS_VERSION> step1.log should solve this problem. Someone can tell me what is missing in my script to perform the compilation successfully.

谢谢!

推荐答案

您的基础架构提供程序(即CodeShip)不为该级别的SDK构建工具提供支持。

Your infrastructure provider (i.e. CodeShip ) doesn't provide support for that level of SDK build tool. Perhaps contacting them might help.

至于在自己的PC上工作时遇到基于Android的错误的人:-

As for the people who got an Android based error while working on their own PC :-

将目录更改为C:\Users\YOURPCNAME\tools\bin
然后在此处运行sdkmanager --licenses
接受许可证,您就可以开始使用

Change directory to C:\Users\YOURPCNAME\tools\bin And over here run sdkmanager --licenses Accept the licenses and you'll be good to go

这篇关于由于某些许可证尚未接受,因此无法安装以下Android SDK软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆