cordova 无法 ganarate apk,说配置项目 ':CordovaLib' 时发生了一些事情

问题描述 投票:0回答:3

我是 ionic 的初学者..并且正在尝试从 ionic 项目生成 apk ..但不幸的是它无法生成,给了我这个错误

 Android Studio project detected

 ANDROID_HOME=C:\Users\abdel ysf\AppData\Local\Android\sdk
 JAVA_HOME=C:\Program Files\java\jdk1.8.0_151
 studio
 Subproject Path: CordovaLib
 Subproject Path: app
 publishNonDefault is deprecated and has no effect anymore. All 
 variants are now published.
 [18:51:59]  lint finished in 15.14 s
 Checking the license for package Android SDK Platform 26 in 
 C:\Users\abdel ysf\AppData\Local\Android\sdk\licenses
 Warning: License for package Android SDK Platform 26 not 
 accepted.

 FAILURE: Build failed with an exception.

 * What went wrong:
 A problem occurred configuring project ':CordovaLib'.
 > 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.

我使用的命令是:ionic cordova build android

android cordova ionic-framework apk
3个回答
3
投票

打开 Android Studio SDK 管理器,在“SDK 平台”选项卡下,选择所需的 Android 版本(例如:Android 8.1(Oreo)),然后单击“确定”。如果错误不断重复,请尝试安装一些以前的 Android 版本。


2
投票

打开Android studio,打开Android SDK管理器。接受SDK的许可。


-1
投票

找到自己本地的android-sdk,如果下载了ndk的相关sdk,会有一个名为“ndk-bundle”的文件夹

enter image description here

里面有一个名为“toolchains”的文件夹。

enter image description here

我们注意到里面没有mips64el相关的文件。

enter image description here

解决方法如下:

点击这里通过浏览器单独下载NDK包。 解压后,打开“toolchains”文件夹,与android-sdk->ndk-bundle->toolchains文件夹进行对比,找到缺少的文件夹,复制过去 3.重新编译,问题解决。 希望对你交友有帮助

© www.soinside.com 2019 - 2024. All rights reserved.