2

I am developing an hybrid mobile app for android and ios with cordova, angularjs and angularmaterial design. I use npm, bower and grund to manage and run build task. I could build ios but not android with error:

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 '/xxx/android-sdk/build-tools/23.0.3/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: 1 mins 0.919 secs
Error: Error code 1 for command: /xxx/platforms/android/gradlew with args: cdvBuildDebug,-b,/xxx/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true.

My environments:

  • [email protected]
  • node_modules node packages
  • bower_components dependencies with bowers
  • angularjs and angular material design

Any help is appreciated.

ps: I run

cordova platform add android
cordova build android

I even tried to remove/add the android but still no luck.

One interesting observe, If I use a blank project then It will be built successfully for both platforms

Thanks

9
  • 1
    DId you tried a command line build? Commented Mar 28, 2016 at 8:02
  • yes. I could build and run in ios but not in android Commented Mar 28, 2016 at 8:12
  • 1
    Any of your components using anroid Ndk? Commented Mar 28, 2016 at 8:13
  • 1
    Try this way create a blank cordaova project and after import to android studio manullay install angularjs and angularmaterial design componets (copy paste) may be this will work Commented Mar 28, 2016 at 8:28
  • 1
    yes. I will consider this as final option. I have so many dependencies. putting one by one take lots of effort. Commented Mar 28, 2016 at 8:38

3 Answers 3

2

I found the issue. I have node_moudles and bower_components inside the www of Cordova project. After moving my nodejs dependencies from www and and remvoe the bower_components folder and try bower install again it works.

I don't really understand what the cordova build android running behind the scene that cause error when having node_modules inside the www.

FYI I just used npm to manage dependency for my development(karma, grunt, httpserver, ...). It is even better to move it from the www.

Sign up to request clarification or add additional context in comments.

Comments

0

Try adding xml namespace for phonegap (xmlns:gap="http://phonegap.com/ns/1.0") to config.xml

2 Comments

On what tag exactly to put that attribute?
put that attribute to widget tag
0

For me the problem was caused by the bower_components. I used the "bower link" command to reference a local bower package so I could work on this simultaneously. But when I tried to build to Android, the build failed with the same error message. Using

bower unlink YOUR_PACKAGE_NAME

(or just removing the 'bower_components' directory) and then reinstalling the packages by

bower install

fixed this issue.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.