Android Gradle内置Visual Studio Team Services sdk许可证错误
我试图在Visual Studio Team Services中创建一个正常工作的android gradle构建定义,但我总是遇到以下错误:Android Gradle内置Visual Studio Team Services sdk许可证错误,android,azure-pipelines,Android,Azure Pipelines,我试图在Visual Studio Team Services中创建一个正常工作的android gradle构建定义,但我总是遇到以下错误: 2016-10-09T07:30:56.0626848Z FAILURE: Build failed with an exception. 2016-10-09T07:30:56.0626848Z 2016-10-09T07:30:56.0626848Z * What went wrong: 2016-10-09T07:30:56.0626848Z A
2016-10-09T07:30:56.0626848Z FAILURE: Build failed with an exception.
2016-10-09T07:30:56.0626848Z
2016-10-09T07:30:56.0626848Z * What went wrong:
2016-10-09T07:30:56.0626848Z A problem occurred configuring project ':twuice_theme'.
2016-10-09T07:30:56.0636849Z > You have not accepted the license agreements of the following SDK components:
2016-10-09T07:30:56.0636849Z [Android SDK Platform 24, Android SDK Build-Tools 24.0.3].
2016-10-09T07:30:56.0636849Z Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
2016-10-09T07:30:56.0636849Z Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
2016-10-09T07:30:56.0636849Z
2016-10-09T07:30:56.0636849Z * Try:
2016-10-09T07:30:56.0636849Z Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
2016-10-09T07:30:56.0636849Z
2016-10-09T07:30:56.0636849Z BUILD FAILED
2016-10-09T07:30:56.0636849Z
2016-10-09T07:30:56.0636849Z Total time: 55.145 secs
2016-10-09T07:30:56.4528586Z [Error: C:\a\1\s\gradlew.bat failed with return code: 1]
2016-10-09T07:30:56.4718591Z ##[error]Error: C:\a\1\s\gradlew.bat failed with return code: 1
2016-10-09T07:30:56.4788582Z ##[section]Finishing: gradlew build
我搜索了一下,但没有找到任何有用的东西,有人能帮我吗
提前感谢定义了修复此错误的方法。下面是如何在VisualStudioTeamServices中修复它。步骤是
- 工具=
mkdir
- 参数=
%ANDROID\u HOME%\licenses“
- 工具=
echo
- 参数=
| set/p=“8933bad161af4178b1185d1a37fbf41ea5269c55”>%ANDROID\u HOME%\licenses\ANDROID sdk license”
- 选中“出错时继续”,因为此echo命令将返回1
- 工具=
更多信息
- 参数=
%ANDROID\u HOME%\licenses\ANDROID sdk license“
这是个好消息。坏消息是,gradle构建步骤在SDK安装过程中失败,错误为“无法移开或删除现有目标文件”。因此,如果您找到了这个问题,请告诉我。感谢Mike提供的解决方法!我遇到的一个问题是,由于步骤2中的错误,构建“部分成功” 为了获得“成功”构建而不是“部分成功”构建,我将三个命令行步骤替换为一个powershell步骤,以执行内联脚本:
New-Item -ItemType Directory -Path "C:\java\androidsdk\android-sdk\licenses"
New-Item -Name 'android-sdk-license' -ItemType File -Value '8933bad161af4178b1185d1a37fbf41ea5269c55' -Path "C:\java\androidsdk\android-sdk\licenses"
Get-Content "C:\java\androidsdk\android-sdk\licenses\android-sdk-license"