使用Gradle在processDebugResources上进行离子构建错误

时间:2016-03-02 19:54:01

标签: android angularjs cordova gradle ionic-framework

我将现有的AngularJS项目移植到Ionic,但是从“离子运行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

我在多个插件上看到了另一篇文章,具体取决于相同的模块,并遵循建议添加一个名为build-extras.gradle的文件:

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

仍然无效。

我也尝试了这个没有成功:

$ cordova platform rm android
$ cordova platform add android

post也无济于事。

我可以毫无问题地构建另一个简单的项目。我想知道我的任何节点模块是否与依赖的Ionic冲突:

<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>

如何解决这个问题?任何帮助表示赞赏。

4 个答案:

答案 0 :(得分:1)

我在www目录中通过deleting the "node_modules" folder解决了这个问题。

我停止在fsevents目录中进一步搜索(www / node_modules / grunt-html2js / node_modules / chokidarnode_modules / fsevents)。文件夹太多了。

答案 1 :(得分:0)

尝试从platforms / android / build.xml中排除节点模块:

<property name="aapt.ignore.assets" value="&lt;dir&gt;node_*" />

答案 2 :(得分:0)

假设您有API 21,我尝试将buildTools的版本更改为:

buildToolsVersion "21.0.2"

build.gradle

答案 3 :(得分:0)

我遇到了同样的问题,并通过执行

找到了问题
./platform/android/gradlew --info build clean