Bad Resource Path on task app:mergeReleaseResources

cordova build android --release gives this following error. I tried everything including running ionic cordova resources as well as deleting the resources folder

Android Studio project detected
ANDROID_HOME=/root/…/mnt/c/Users/armaa/AppData/Local/Android/Sdk
JAVA_HOME=/usr
studio
:wrapper

BUILD SUCCESSFUL

Total time: 5.273 secs

This build could be faster, please consider using the Gradle Daemon: Chapter 6. The Gradle Daemon
Subproject Path: CordovaLib
Subproject Path: app
Starting a Gradle Daemon (subsequent builds will be faster)
publishNonDefault is deprecated and has no effect anymore. All variants are now published.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_b7addsy8zf7x7zfbxfp3zv08p.run(/mnt/c/Users/armaa/Desktop/coding/ionic/test/platforms/android/app/build.gradle:148)
Configuration ‘compile’ in project ‘:app’ is deprecated. Use ‘implementation’ instead.
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:compileReleaseAidl
:CordovaLib:compileReleaseRenderscript
:CordovaLib:checkReleaseManifest
:CordovaLib:generateReleaseBuildConfig
:CordovaLib:prepareLintJar
:CordovaLib:generateReleaseResValues
:CordovaLib:generateReleaseResources
:CordovaLib:packageReleaseResources
:CordovaLib:platformAttrExtractor
:CordovaLib:processReleaseManifest
:CordovaLib:javaPreCompileRelease
:CordovaLib:processReleaseJavaRes NO-SOURCE
:app:preBuild UP-TO-DATE
:app:preReleaseBuild
:app:compileReleaseAidl
:CordovaLib:packageReleaseRenderscript NO-SOURCE
:app:compileReleaseRenderscript
:app:checkReleaseManifest
:app:generateReleaseBuildConfig
:app:prepareLintJar
:app:generateReleaseResValues
:app:generateReleaseResources
error: bad resource path (/mnt/c/Users/armaa/Desktop/coding/ionic/test/platforms/android/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml).

:app:mergeReleaseResources
Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details
:app:mergeReleaseResources FAILED

18 actionable tasks: 18 executed
FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:mergeReleaseResources’.

Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

  • 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 16s
/mnt/c/Users/armaa/Desktop/coding/ionic/test/platforms/android/gradlew: Command failed with exit code 1 Error output:
error: bad resource path (/mnt/c/Users/armaa/Desktop/coding/ionic/test/platforms/android/app/build/intermediates/incremental/mergeReleaseResources/merged.dir/values/values.xml).

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:app:mergeReleaseResources’.

Error: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

  • 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 16s
[ERROR] An error occurred while running subprocess cordova.

    cordova build android --release exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

my ionic info

Ionic:

Ionic CLI : 5.2.5 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.7.4
@angular-devkit/build-angular : 0.801.3
@angular-devkit/schematics : 8.1.3
@angular/cli : 8.1.3
@ionic/angular-toolkit : 2.0.0

Cordova:

Cordova CLI : 8.1.2 (cordova-lib@8.1.1)
Cordova Platforms : android 7.1.4
Cordova Plugins : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 4 other plugins)

Utility:

cordova-res : 0.6.0
native-run : 0.2.8

System:

Android SDK Tools : 26.1.1 (/root/…/mnt/c/Users/armaa/AppData/Local/Android/Sdk)
NodeJS : v11.10.1 (/usr/local/bin/node)
npm : 6.8.0
OS : Linux 4.4