Build failure with Gradle

I ported an existing AngularJS project to Ionic, but got this build error from “ionic run Android”:


:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources FAILED

FAILURE: Build failed with an exception.

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

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/Users/Frank/Library/Android/sdk/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: 6.07 secs
ERROR running one or more of the platforms: Error code 1 for command: /Users/Frank/Documents/Code/MyAppClientWeb/MyApp/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/Frank/Documents/Code/MyAppClientWeb/MyApp/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
You may not have the required environment or OS to run this project

I saw another post on multiple plug-ins depending on the same module, and followed suggestion to add a file named build-extras.grade with this:

android {
packagingOptions {
exclude ‘META-INF/ASL2.0’
exclude ‘META-INF/LICENSE’
exclude ‘META-INF/NOTICE’
}
}

Still does’t work.

How to fix this? Any help is appreciated.

$ cordova platform rm android
$ cordova platform add android

Lealandre, Thank you. I tried it, but got the same errors.

I was wondering if any of my node modules are conflicting with Ionic on dependency:

<script type="text/javascript" src="node_modules/angular-aria/angular-aria.js"></script>
<script type="text/javascript" src="node_modules/angular-material/angular-material.js"></script>
<script type="text/javascript" src="node_modules/angular-ui-router/build/angular-ui-router.js"></script>
<script type="text/javascript" src="node_modules/closure-library/closure/goog/base.js"></script>
<script type="text/javascript" src="node_modules/angular-google-maps/node_modules/lodash/index.js"></script>
<script type="text/javascript" src="node_modules/angular-google-maps/node_modules/angular-simple-logger/dist/index.js"></script>
<script type="text/javascript" src="node_modules/angular-google-maps/dist/angular-google-maps.js"></script>
<script type="text/javascript" src="SimeonC-md-date-time-3395233/dist/md-date-time.js"></script>
<script type="text/javascript" src="bower_components/angular-rateit/dist/ng-rateit.js"></script>