cordova android build failure: processArmv7DebugResources

Viewed 5561

I'm building a hybrid app with cordova. The setup has been tested with simple application. Both android and iOS build works fine.

After switching to a more complex application, the following error occurred. I googled and found some suggested solution but none of the worked.

I'm new to this so any suggestion appreciated.

:processArmv7DebugResources FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processArmv7DebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/local/Cellar/android-sdk/24.4.1_1/build-tools/23.0.2/aapt'' finished with non-zero exit value 1

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

BUILD FAILED

Total time: 28.659 secs
ERROR building one of the platforms: Error code 1 for command: /Users/wliang/work/hzoom/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/wliang/work/hzoom/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
You may not have the required environment or OS to build this project
Error: Error code 1 for command: /Users/wliang/work/hzoom/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/wliang/work/hzoom/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
7 Answers

This is an old issue, but I recently came upon the same one and hope my experience might help someone else in the future.

After a solid day of looking around I realized it had to do with my plugins. For some reason there was an unused dependency in package.json that wouldn't allow it to build.

In my case, it was Firebase, and after removing it from package.json and the plugins folder I ran

cordova platform remove android

and

cordova platform add android

then built it again and all of a sudden it was up and running!

For me it was the node_modules folder inside www that caused the problem.

The solution is to copy your www to another folder and exclude node_modules and you will be fine.

This is might because you use crosswalk,

You can try the following commands:

    sudo ionic cordova platform remove android 
    sudo rm -rf ./node_modules
    sudo npm install --unsafe-perm=true --allow-root
    sudo npm install --unsafe-perm node-sass
    sudo ionic cordova platform add android@6.4.0 
    sudo ionic cordova plugin add cordova-android-support-gradle-release
    sudo ionic cordova build android 
Related