任务':app:processReleaseResources'的执行失败。无法执行aapt

时间:2018-04-02 17:34:07

标签: ionic-framework ionic3 apk ionic-native

我正在部署离子应用apk。我一直收到这个错误。任何帮助请:)

*

FAILURE: Build failed with an exception.

    * What went wrong:
    Execution failed for task ':app:processReleaseResources'.
    > 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 12s
        at ChildProcess.whenDone (C:\Users\KING WOODE\Desktop\testapp\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23)
        at ChildProcess.emit (events.js:160:13)
        at maybeClose (internal/child_process.js:943:16)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
    (node:5560) 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:5560) [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.

*

3 个答案:

答案 0 :(得分:2)

这对我有用

cordova plugin add cordova-android-support-gradle-release

答案 1 :(得分:0)

首先你需要从项目中删除android平台并重新安装android平台。

删除android平台:

ionic cordova platform rm android

安装android平台:

ionic cordova platform add android

然后尝试再次构建项目,如果它不起作用,尝试删除插件文件夹并再次重新安装cordova插件。

答案 2 :(得分:0)

查看cordova-android-support-gradle-release插件。它“将其他插件指定的各种版本的Android支持库与特定版本对齐。”

  

一些Cordova插件包含Android Support Libraries以便于它们。最常见的是,这些现在通过将它们指定为Gradle依赖项而包含在Cordova项目中(请参阅Cordova plugin spec documentation)。 (...)当这些插件指定不同版本的支持库时,会出现问题。这可能导致构建失败。 (...)要解决这些版本冲突,此插件会将Gradle配置文件注入本机Android平台项目,该项目将覆盖其他插件指定的任何版本,并强制它们使用其Gradle文件中指定的版本。