问题描述
我正在开发一款用于android和ios的混合移动应用程序,包括cordova,angularjs和angularmaterial设计。我使用npm,bower和grund来管理和运行构建任务。我可以建立ios,但不是android与错误:
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.
我的环境:
-
-
- node_modules节点套件
- bower_components与bowers的依存关系
- angularjs和角材料设计
任何帮助是值得赞赏的。
Any help is appreciated.
ps:I
cordova platform add android
cordova build android
我甚至试图删除/添加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
感谢
推荐答案
我发现了问题。我在Cordova项目的www中有node_moudles和bower_components。在移动我的nodejs依赖关系从www和和remvoe bower_components文件夹,并尝试bower安装再次工作。
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.
我真的不明白什么cordova构建安卓运行后面当在www中有node_modules时会导致错误的场景。
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我只是使用npm管理我的开发的依赖(karma,grunt,httpserver,...)。更好的办法是从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.
这篇关于Cordova build android错误任务执行失败':processDebugResources'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!