android - 使用 Gradle 在 processDebugResources 上 ionic 构建错误

标签 android angularjs cordova gradle ionic-framework

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

我看到另一篇关于依赖于同一个模块的多个插件的帖子,并按照建议添加一个名为 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>

如何解决这个问题?感谢您的帮助。

最佳答案

我通过删除 www 目录中的“node_modules”文件夹 解决了这个问题。

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

关于android - 使用 Gradle 在 processDebugResources 上 ionic 构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35756831/

相关文章:

iphone - 如何在没有 Apple 硬件(iPhone + Mac)的情况下将 Phonegap 应用程序部署到 iPhone

android - 关于 PhoneGap 中 FileTransfer() 下载的问题

Android Emulator 的启动选项在 Eclipse 插件中不起作用?

android - 标准和自定义 GATT 特性

android - 未能以隐含的 Intent 开始 Activity

javascript - $createUser(credentials) - Firebase 创建 Slack 的克隆

angularjs - 如何将 HTML 传递给 Angular 指令?

javascript - 动态输入,避免在不同元素上重复

Cordova : Content Security Policy directive: "media-src *"

ios - 电话后的 PhoneGap 事件