Visual Studio Team Services SDK许可中的Android Gradle构建 [英] Android Gradle build in Visual Studio Team Services sdk license error

查看:85
本文介绍了Visual Studio Team Services SDK许可中的Android Gradle构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Visual Studio Team Services中创建有效的android gradle构建定义,但是我总是会收到此错误:

I'm trying to create a working android gradle build definition in Visual Studio Team Services but I always get this error:

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

我搜索了但没有发现有用的东西,所以有人可以帮我吗?

I searched but didn't find anything useful, so could somebody help me?

预先感谢

推荐答案

此处中定义了解决此错误的方法.这是在Visual Studio Team Services中修复它的方法.步骤是

The method of fixing this error is defined here. Here is how you fix it within Visual Studio Team Services. The steps are

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

这是详细信息:

  1. 在实用程序"类别中创建一个类型为命令行"的新构建步骤".

  1. Create a new "Build step" of type "Command Line" which is in the "Utilities" category.

  • 工具= mkdir
  • 参数= "%ANDROID_HOME%\licenses"
  • Tool = mkdir
  • Arguments = "%ANDROID_HOME%\licenses"

创建另一个命令行"构建步骤.

Create another "Command Line" build step.

  • 工具= echo
  • 参数= |set /p="8933bad161af4178b1185d1a37fbf41ea5269c55" > "%ANDROID_HOME%\licenses\android-sdk-license"
  • 选中继续执行错误" ,因为此echo命令将返回1.
  • Tool = echo
  • Arguments = |set /p="8933bad161af4178b1185d1a37fbf41ea5269c55" > "%ANDROID_HOME%\licenses\android-sdk-license"
  • Check "Continue on error" because this echo command will return 1.
  • 工具= more
  • 参数= "%ANDROID_HOME%\licenses\android-sdk-license"
  • Tool = more
  • Arguments = "%ANDROID_HOME%\licenses\android-sdk-license"

在执行"Gradle"构建步骤之前,以1,2,3顺序放置这些构建步骤.

Place these build steps in 1,2,3 order prior to executing your "Gradle" build step.

这是个好消息.坏消息是,在SDK安装过程中,gradle构建步骤失败,并显示错误无法移走或删除现有目标文件".因此,请告诉我您是否想出那个.

That's the good news. The bad news is that the gradle build step is failing during SDK installation with the error "Failed to move away or delete existing target file." So let me know if you figure that one out.

这篇关于Visual Studio Team Services SDK许可中的Android Gradle构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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