Visual Studio Team Services sdk 中的 Android Gradle 构建许可证错误

2023-12-04

我正在尝试在 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 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

我搜索了但没有找到任何有用的东西,所以有人可以帮助我吗?

提前致谢


定义了修复此错误的方法here。以下是在 Visual Studio Team Services 中修复此问题的方法。步骤是

  1. 创建“%ANDROID_HOME%\licenses”目录。
  2. 创建“%ANDROID_HOME%\licenses\android-sdk-license”文件。
  3. 输出创建的文件的内容以进行验证。

详细信息如下:

  1. 创建一个“命令行”类型的新“构建步骤”,位于“实用程序”类别中。

    • Tool = mkdir
    • 参数 ="%ANDROID_HOME%\licenses"
  2. 创建另一个“命令行”构建步骤。

    • Tool = echo
    • 参数 =|set /p="8933bad161af4178b1185d1a37fbf41ea5269c55" > "%ANDROID_HOME%\licenses\android-sdk-license"
    • 勾选“出错时继续”因为这个 echo 命令将返回 1。
  3. For verification, create a third "Command Line" build step
    • Tool = more
    • 参数 ="%ANDROID_HOME%\licenses\android-sdk-license"

在执行“Gradle”构建步骤之前,按照 1、2、3 的顺序放置这些构建步骤。

这是个好消息。坏消息是,在 SDK 安装过程中,gradle 构建步骤失败,并出现错误“无法移走或删除现有目标文件”。如果你弄清楚了,请告诉我。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Visual Studio Team Services sdk 中的 Android Gradle 构建许可证错误 的相关文章

随机推荐