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

问题描述 投票:-1回答:3

我正在部署一个离子应用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.

*

ionic-framework ionic3 apk ionic-native
3个回答
2
投票

这对我有用

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


0
投票

首先,您需要从项目中删除Android平台并重新安装Android平台。

删除android平台:

ionic cordova platform rm android

安装android平台:

ionic cordova platform add android

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


0
投票

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

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

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