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

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

问题描述

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

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:

...

...

在以下位置检查软件包Android SDK Platform 26的许可证 C:\ Android \ android-sdk \ licenses警告:Android软件包的许可证 SDK Platform 26不被接受.

Checking the license for package Android SDK Platform 26 in C:\Android\android-sdk\licenses Warning: License for package Android SDK Platform 26 not accepted.

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

FAILURE: Build failed with an exception.

  • 出了什么问题:配置根项目"android"时出现问题.

您尚未接受以下SDK组件的许可协议:[Android SDK Platform 26].在建立专案之前, 您需要接受许可协议并完成 使用Android Studio SDK安装缺少的组件 经理.或者,学习如何转让许可证 从一个工作站到另一个工作站的协议,请转到 http://d.android.com/r/studio-ui/export-licenses.html

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

在阅读其他问题时,人们建议使用Android Studio SDK管理器并安装最新版本,因为这样一来,我会被询问许可证并必须接受它们,因此我安装了Android 8.0(Oreo)和Android API 27是最新的可用更新,但是,我从未询问过任何许可证,并且该错误仍然存​​在.我的设备通过USB电缆连接到PC(Windows 10),并且启用了编程器模式以及USB调试功能.我该怎么办才能解决这个问题?

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?

我的SDK管理器:

更新:

我已经在C:\Android\sdk\tools\binC:\Users\User\AppData\Local\Android\sdk\tools\bin文件夹中运行了命令sdkmanager --licenses,并且所有丢失的许可证均已接受,但错误仍然存​​在.

I already ran the command sdkmanager --licenses in the C:\Android\sdk\tools\bin and C:\Users\User\AppData\Local\Android\sdk\tools\bin folders and all the missing licenses were accepted, but the error continues.

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

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)

出现以下错误:

在以下位置检查软件包Android SDK Platform 26的许可证 C:\ Android \ android-sdk \ licenses警告:Android软件包的许可证 SDK Platform 26不被接受.

Checking the license for package Android SDK Platform 26 in C:\Android\android-sdk\licenses Warning: License for package Android SDK Platform 26 not accepted.

但是我在C:\Android\android-sdk中没有许可证文件夹,仅在C:\Android\sdk中.我该如何做Ionic检查许可证实际所在的文件夹?

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

ionic info:

cli packages: (C:\Users\User\AppData\Roaming\npm\node_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:\Android\android-sdk

Misc:

    backend : pro

推荐答案

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

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

...

...

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

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

...

所以我刚去C:\Android\sdk并将licenses文件夹复制到Ionic搜索许可证的C:\Android\android-sdk文件夹.

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

感谢所有尝试以某种方式提供帮助的人.

Thanks to all who have somehow tried to help.

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

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