Android 构建工具 26.0.2 不接受许可证
License not accepted for Android Build tools 26.0.2
我向 Jenkins 上传了一个新项目,其 compileSdkVersion 为 26,targetSdkVersion 为 25。我已使用以下命令接受 sdk 的所有许可:
./sdkmanager --licenses
一切都在我的电脑上运行良好,但是当我在 Jenkins 上构建时它抛出以下错误:
Starting a Gradle Daemon (subsequent builds will be faster)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
Configuration 'testCompile' in project ':app' is deprecated. Use'testImplementation' instead.
Configuration 'provided' in project ':app' is deprecated. Use 'compileOnly' instead.
Checking the license for package Android SDK Build-Tools 26.0.2 in
/Users/Shared/Jenkins/Library/Android/sdk/licenses
Warning: License for package Android SDK Build-Tools 26.0.2 not
accepted.
Checking the license for package Android SDK Platform 26 in
/Users/Shared/Jenkins/Library/Android/sdk/licenses
Warning: License for package Android SDK Platform 26 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK
components:
[Android SDK Platform 26, Android SDK Build-Tools 26.0.2].
我运行同样的命令在Jenkins机器上接受许可,它说所有的许可都已被接受。我不确定出了什么问题。
有人可以帮忙吗?
谢谢
我相信你的目标SDK也应该是26
可能您接受了 SDK API 的许可,但构建工具位于第二个选项卡中。从 Android Studio 打开它并确保覆盖所有选项卡,而不仅仅是第一个。
要从 AS 找到 SDK 管理器,请转至文件、设置、外观和行为、系统设置、Android SDK。检查显示 SDK 工具的第二个选项卡。
我能够解决这个问题。实际问题是 local.properties 文件丢失了 android sdk 路径
我向 Jenkins 上传了一个新项目,其 compileSdkVersion 为 26,targetSdkVersion 为 25。我已使用以下命令接受 sdk 的所有许可:
./sdkmanager --licenses
一切都在我的电脑上运行良好,但是当我在 Jenkins 上构建时它抛出以下错误:
Starting a Gradle Daemon (subsequent builds will be faster)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
Configuration 'testCompile' in project ':app' is deprecated. Use'testImplementation' instead.
Configuration 'provided' in project ':app' is deprecated. Use 'compileOnly' instead.
Checking the license for package Android SDK Build-Tools 26.0.2 in
/Users/Shared/Jenkins/Library/Android/sdk/licenses
Warning: License for package Android SDK Build-Tools 26.0.2 not
accepted.
Checking the license for package Android SDK Platform 26 in
/Users/Shared/Jenkins/Library/Android/sdk/licenses
Warning: License for package Android SDK Platform 26 not accepted.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> You have not accepted the license agreements of the following SDK
components:
[Android SDK Platform 26, Android SDK Build-Tools 26.0.2].
我运行同样的命令在Jenkins机器上接受许可,它说所有的许可都已被接受。我不确定出了什么问题。
有人可以帮忙吗?
谢谢
我相信你的目标SDK也应该是26
可能您接受了 SDK API 的许可,但构建工具位于第二个选项卡中。从 Android Studio 打开它并确保覆盖所有选项卡,而不仅仅是第一个。
要从 AS 找到 SDK 管理器,请转至文件、设置、外观和行为、系统设置、Android SDK。检查显示 SDK 工具的第二个选项卡。
我能够解决这个问题。实际问题是 local.properties 文件丢失了 android sdk 路径