【问题标题】:Cordova build android shows "You have not accepted the license agreements of the following SDK components"Cordova build android显示“您尚未接受以下SDK组件的许可协议”
【发布时间】:2017-08-21 06:46:14
【问题描述】:

我正在从事 Ionic3 项目。使用cordova build android 构建应用程序时显示此错误

FAILURE:构建失败并出现异常。

* What went wrong:
A problem occurred configuring root project 'android'.
> You have not accepted the license agreements of the following SDK components:
  [Android SDK Build-Tools 26.0.1, Android SDK Platform 25].
  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.
  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

我已关注与此类错误相关的 stackoverflow 答案。但它仍然显示此错误

我已按照以下程序来克服错误。

  1. 成功添加ANDROID_HOME目录
  2. 使用以下命令接受所有许可证

    ./sdkmanager --licenses

在($ANDROID_HOME/Android/Sdk/tools/bin)目录

发生此错误的主要问题是什么? 如何克服这个问题? 有没有其他方法可以解决这个问题?

【问题讨论】:

  • @Niroshan8889 打开您的 android sdk 管理器并安装 Android SDK Build-Tools 26.0.1 和 Android SDK Platform 25。安装时您必须手动接受许可,应该这样做
  • 我已经成功安装了sdk工具,但错误仍然存​​在
  • This answer 解决了这个问题。

标签: android cordova gradle ionic2 android-gradle-plugin


【解决方案1】:

更简单的方法是 在命令提示符下运行:

mkdir "%ANDROID_HOME%\licenses"

echo|set/p="8933bad161af4178b1185d1a37fbf41ea5269c55""%ANDROID_HOME%\licenses\android-sdk-license"

然后从您设置为 Android Home 的文件夹中找到它或者: 您可以轻松:

mkdir "包含 Android-sdk\licenses 的文件夹"

回声 |set /p="8933bad161af4178b1185d1a37fbf41ea5269c55" "包含 Android-sdk\licenses\android-sdk-license 的文件夹"

记住要使用 echo 或 set。

祝你好运

更多来自This Previous Answer

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-04-30
    • 2017-02-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-03
    • 2017-03-16
    • 1970-01-01
    相关资源
    最近更新 更多