Execution failed for task ':app:processReleaseResources'

I guess there are many topics about it, but all the solution didn’t work.
So, I made the topic one more time for people who still have the problem.

Bug Report

I’m trying to build an android app by ionic cordova build android --release .
However, the next error occurred.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processReleaseResources'.
> Failed to execute aapt

What I tried

cordova plugin add cordova-android-support-gradle-release
=> removed and readded platform
=> still had the same error.

ionic info

Ionic:

   Ionic CLI          : 5.0.2
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : android 7.0.0, ios 4.5.5
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.0, (and 11 other plugins)

Utility:

   cordova-res : 0.3.0
   native-run  : not installed

System:

   Android SDK Tools : 26.1.1 (/Users/UserName/Library/Android/sdk)
   ios-deploy        : 1.9.4
   NodeJS            : v8.16.0 (/usr/local/bin/node)
   npm               : 6.4.1
   OS                : macOS Mojave
   Xcode             : Xcode 10.3 Build version 10G8

npm list --depth=0

MainApp
├── @angular/animations@5.2.11
├── @angular/common@5.2.11
├── @angular/compiler@5.2.11
├── @angular/compiler-cli@5.2.11
├── @angular/core@5.2.11
├── @angular/forms@5.2.11
├── @angular/http@5.2.11
├── @angular/platform-browser@5.2.11
├── @angular/platform-browser-dynamic@5.2.11
├── @ionic-native/camera@4.20.0
├── @ionic-native/core@4.18.0
├── @ionic-native/fcm@4.20.0
├── @ionic-native/file@4.20.0
├── @ionic-native/http@4.20.0
├── @ionic-native/in-app-browser@4.20.0
├── @ionic-native/splash-screen@4.18.0
├── @ionic-native/status-bar@4.18.0
├── @ionic/app-scripts@3.2.1
├── @ionic/lab@1.0.24
├── @ionic/storage@2.2.0
├── algoliasearch@3.33.0
├── cordova-android@7.0.0
├── cordova-android-support-gradle-release@3.0.1
├── cordova-ios@4.5.5
├── cordova-plugin-advanced-http@2.1.1
├── cordova-plugin-camera@4.0.3
├── cordova-plugin-compat@1.2.0
├── cordova-plugin-device@2.0.2
├── cordova-plugin-fcm@2.1.2
├── cordova-plugin-file@4.2.0
├── cordova-plugin-inappbrowser@3.0.0
├── cordova-plugin-ionic-keyboard@2.1.3
├── cordova-plugin-ionic-webview@4.1.0
├── cordova-plugin-splashscreen@5.0.2
├── cordova-plugin-statusbar@2.4.2
├── cordova-plugin-whitelist@1.3.3
├── firebase@5.8.3
├── ionic@5.0.2
├── ionic-angular@3.9.2
├── ionicons@3.0.0
├── rxjs@5.5.11
├── sw-toolbox@3.6.0
├── typescript@2.6.2
└── zone.js@0.8.26

I’m very glad if someone can solve this problem.

Hello,
use this cmd: ionic cordova build android --prod --release

--prod Flag to use the production configuration

For more details check it out: ionic cordova build

Thanks for your reply!!
I will try that today, and report back :slight_smile: