Ionic 3 中的 Android SDK 平台 26 许可证错误 [英] Android SDK Platform 26 license error in Ionic 3

查看:19
本文介绍了Ionic 3 中的 Android SDK 平台 26 许可证错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 ionic cordova run android --device --stacktrace 在我的 Android 设备上运行我的 Ionic 3 项目,但是,我有以下输出:

<块引用>

...

检查包 Android SDK Platform 26 的许可证C:Androidandroid-sdklicenses 警告:Android 软件包的许可证不接受 SDK 平台 26.

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

  • 出了什么问题:配置根项目android"时出现问题.
<块引用>

您尚未接受以下 SDK 组件的许可协议:[Android SDK Platform 26].在构建项目之前,您需要接受许可协议并完成使用 Android Studio SDK 安装缺少的组件经理.或者,了解如何转让许可证从一个工作站到另一个工作站的协议,转到

更新:

我已经在 C:Androidsdk oolsinC:UsersUserAppData 中运行了命令 sdkmanager --licensesLocalAndroidsdk oolsin 文件夹和所有丢失的许可证都被接受,但错误仍然存​​在.

package.json 中的我的 cordova-android 版本:"cordova-android":"~6.3.0"config.xml: <engine name="android" spec="~6.3.0"/>(已经用 6.3.06.2.0 没有成功)

跟随错误:

<块引用>

检查包 Android SDK Platform 26 的许可证C:Androidandroid-sdklicenses 警告:Android 软件包的许可证不接受 SDK 平台 26.

但我在 C:Androidandroid-sdk 中没有 licenses 文件夹,只是在 C:Androidsdk 中.我如何为 Ionic 检查许可证真正所在的文件夹?

离子信息:

cli 包:(C:UsersUserAppDataRoaming
pm
ode_modules)@ionic/cli-utils:1.19.0离子(离子 CLI):3.19.0全局包:科尔多瓦(科尔多瓦 CLI):7.1.0本地包:@ionic/app-scripts:3.1.0Cordova 平台:无离子框架:离子角 3.9.2系统:节点:v6.11.2npm:3.10.10操作系统:Windows 10环境变量:ANDROID_HOME : C:Androidandroid-sdk杂项:后端:亲

解决方案

解决了!阅读页面上的信息 http://tools.android.com/tech-docs/new-build-system/license:

<块引用>

...

如果您在一台工作站上接受了许可协议,但希望在不同的项目上构建您的项目,您可以导出您的项目通过从 Android Sdk 复制接受的许可证文件夹来获得许可证主文件夹

...

所以我只是去了 C:Androidsdk 并将许可证文件夹复制到 Ionic 正在搜索的 C:Androidandroid-sdk 文件夹许可证.

感谢所有试图提供帮助的人.

I'm trying to run my Ionic 3 project on my Android device with ionic cordova run android --device --stacktrace, but, I've the following output:

...

Checking the license for package Android SDK Platform 26 in C:Androidandroid-sdklicenses Warning: License for package Android SDK Platform 26 not accepted.

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring root project 'android'.

You have not accepted the license agreements of the following SDK components: [Android SDK Platform 26]. 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

Reading other questions, people suggested using the Android Studio SDK manager and installing the latest versions, because then I would be asked about the licenses and would have to accept them, so I installed Android 8.0 (Oreo) and Android API 27 which are the last available updates, however, at no time was I asked about any license and the error persisted. My device is connected to the PC (Windows 10) via the USB cable and the programmer mode is enabled along with USB debugging. What can I do to resolve this?

My SDK manager:

Update:

I already ran the command sdkmanager --licenses in the C:Androidsdk oolsin and C:UsersUserAppDataLocalAndroidsdk oolsin folders and all the missing licenses were accepted, but the error continues.

My cordova-android version in package.json: "cordova-android": "~6.3.0" and in config.xml: <engine name="android" spec="~6.3.0" /> (already tried with 6.3.0 and 6.2.0 without success)

Following the error:

Checking the license for package Android SDK Platform 26 in C:Androidandroid-sdklicenses Warning: License for package Android SDK Platform 26 not accepted.

But I don't have the licenses folder in C:Androidandroid-sdk, just in C:Androidsdk. How I do for Ionic check for the folder where the licenses really are?

ionic info:

cli packages: (C:UsersUserAppDataRoaming
pm
ode_modules)

    @ionic/cli-utils  : 1.19.0
    ionic (Ionic CLI) : 3.19.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.0
    Cordova Platforms  : none
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v6.11.2
    npm  : 3.10.10
    OS   : Windows 10

Environment Variables:

    ANDROID_HOME : C:Androidandroid-sdk

Misc:

    backend : pro

解决方案

Solved! Reading the information on the page http://tools.android.com/tech-docs/new-build-system/license:

...

If you have accepted the license agreements on one workstation, but wish to build your projects on a different one, you can export your licenses by copying the accepted licenses folder from the Android Sdk Home folder

...

So I just went to C:Androidsdk and copied the licenses folder to the C:Androidandroid-sdk folder which was where Ionic was searching for the licenses.

Thanks to all who have somehow tried to help.

这篇关于Ionic 3 中的 Android SDK 平台 26 许可证错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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