Cordova build android秀;您尚未接受以下SDK组件的许可协议;

Cordova build android秀;您尚未接受以下SDK组件的许可协议;,android,cordova,gradle,ionic2,android-gradle-plugin,Android,Cordova,Gradle,Ionic2,Android Gradle Plugin,我是,在Ionic3项目上工作。当使用cordova build android构建应用程序时,其显示此错误 失败:生成失败,出现异常 * 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-Tool

我是,在Ionic3项目上工作。当使用cordova build android构建应用程序时,其显示此错误

失败:生成失败,出现异常

* 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
我遵循了与这类错误相关的答案。但它仍然显示了这个错误

我遵循以下步骤来克服错误

  • 已成功添加
    ANDROID\u HOME
    目录
  • 使用以下命令接受所有许可证

    /sdkmanager—许可证

  • 在($ANDROID\u HOME/ANDROID/Sdk/tools/bin)目录下

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

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

    mkdir“%ANDROID\u HOME%\licenses”

    echo | set/p=“8933bad161af4178b1185d1a37fbf41ea5269c55”“%ANDROID|u HOME%\licenses\ANDROID sdk license”

    然后从设置为Android主页的文件夹中找到它,或者: 你可以很容易地:

    mkdir“包含Android sdk\licenses的文件夹”

    echo | set/p=“8933bad161af4178b1185d1a37fbf41ea5269c55” “包含Android sdk\licenses\Android sdk许可证的文件夹”

    记住使用echo或set

    还有你的好去处


    更多信息来自

    @Niroshan8889打开您的android sdk管理器,安装android sdk构建工具26.0.1和android sdk平台25。在安装过程中,您必须手动接受许可证,这应该是我已经成功安装了sdk工具,但还是解决了这个问题。