Ionic cordova未能ganarate apk说有somthing发生配置项目“:CordovaLib”

63lcw9qa  于 2023-10-14  发布在  Ionic
关注(0)|答案(3)|浏览(200)

我是一个初学者在离子。我正试图从一个离子项目生成的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安卓

n53p2ov0

n53p2ov01#

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

0ve6wy6x

0ve6wy6x2#

打开Android Studio,打开Android SDK管理器。接受SDK许可证。

jmp7cifd

jmp7cifd3#

找到自己本地的android-sdk,如果下载了ndk的相关sdk,会有一个名为“ndk-bundle”的文件夹
enter image description here
里面有一个名为“工具链”的文件夹。
enter image description here
我们注意到里面没有mips 64 el相关的文件。
enter image description here
解决方案如下:
单击here,通过浏览器单独下载NDK包。解压后,打开“toolchains”文件夹,与android-sdk->ndk-bundle->toolchains文件夹进行比较,找到丢失的文件夹,复制过去3.重新编译,问题就解决了。希望对你有帮助

相关问题