android - Cordova 构建 android 显示 "You have not accepted the license agreements of the following SDK components"

标签 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-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 ) 目录

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

最佳答案

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

mkdir "%ANDROID_HOME%\licenses"

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

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

mkdir "folder containing Android-sdk\licenses"

echo |set /p="8933bad161af4178b1185d1a37fbf41ea5269c55" "folder containing Android-sdk\licenses\android-sdk-license"

请记住使用 echo 或 set。

还有你的好去处

更多来自 This Previous Answer

关于android - Cordova 构建 android 显示 "You have not accepted the license agreements of the following SDK components",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45790797/

相关文章:

android - 显示正规数而不是指数形式

android - 如果设备连接到路由器,如何检查互联网连接可用性?

android - 在 Android 混合应用中使用 Pdf.js 加载本地文件

javascript - Base64字符串在客户端压缩,在服务器端解压

android - 为什么将 zip 文件上传到 phonegap 服务时出现错误?

kotlin - 如何在Kotlin/Multiplatform项目中使用Gradle liquibaseRuntime配置

kotlin - 当使用两个包含相同类文件的 SDK 的 .aar 文件时,如何在 Kotlin 中解决这个重复的类?

Android sqlite 返回 : error code = 14

java - LibGDX WrappedText 但通过在文本中使用颜色(java)

android - 最新 gradle 5.4.1 问题 - 字符串中未转义的撇号