首页 > 解决方案 > ionic中的Android构建错误-包括Cordova插件文件

问题描述

下面的错误似乎是在我的项目中使用cordova插件'file'和'file-opener2'。删除插件后,它会生成正确的 android 构建。

我还尝试将cordova版本设置为7.1.0,将cordova平台android设置为6.4.0版本。尽管错误不同,但构建仍然失败

* Wh
at went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
    at ChildProcess.whenDone (/Users/Naresh/Documents/AnshFertilityApp/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at ChildProcess.emit (events.js:180:13)
    at maybeClose (internal/child_process.js:936:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
(node:99591) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:99591) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我目前的离子信息:

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.1.9
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v9.8.0
    npm  : 5.6.0 
    OS   : macOS High Sierra

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

标签: androidionic-frameworkionic3cordova-pluginscordova-android

解决方案


我安装了这个插件,它工作正常:

https://github.com/dpa99c/cordova-android-support-gradle-release


推荐阅读