在我使用ngCordova为离子应用程序发出几个命令后,所有事情都发生了 - 离子启动“App Project Name” - 离子平台添加android - 离子构建android
:processDebugResources Unable to add '/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/assets/debug/www/node_modules/try-thread-sleep/node_modules/thread-sleep/node_modules/node-pre-gyp/node_modules/tar-pack/test/fixtures/packed.tar.gz': file already in archive (try '-u'?)
错误:打包时无法处理资产'/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_' 错误:'/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_'的包装失败 FAILED
失败:构建因异常而失败。
出了什么问题: 任务':processDebugResources'执行失败。
com.android.ide.common.internal.LoggedErrorException:无法运行命令: /Users/desmondlai/Library/Android/sdk/build-tools/23.0.2/aapt package -f --no-crunch -I /Users/desmondlai/Library/Android/sdk/platforms/android-22/android.jar -M /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml -S / Users / desmondlai / Desktop / hairCorner / HairProject / platforms / android / build / intermediates / res / debug -A / Users / desmondlai / Desktop / hairCorner / HairProject / platforms / android / build / intermediates / assets / debug -m -J / Users / desmondlai / desktop / hairCorner / HairProject / platforms / android / build / generated / source / r / debug -F /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package com.ionicframework.starter - 0 apk --output-text-symbols / Users / desmondlai / Desktop / hairCorner / HairProject / platforms / android / build / intermediates / symbols / debug 错误代码: 1 输出: 无法添加'/ Users / desmondlai / Desktop / hairCorner / HairProject / platforms / android / build / intermediates / assets / debug / www / node_modules / try-thread-sleep / node_modules / thread-sleep / node_modules / node-pre-gyp /node_modules/tar-pack/test/fixtures/packed.tar.gz':文件已经存档(试试'-u'?) 错误:打包时无法处理资产'/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_' 错误:包装'/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_'失败
尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。
建立失败
总时间:45.169秒
/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/cordova/node_modules/q/q.js:126 扔掉; ^ 命令的错误代码1:/ Users / desmondlai / Desktop / hairCorner / HairProject / platforms / android / gradlew with args:cdvBuildDebug,-b,/ Users / desmondlai / Desktop / hairCorner / HairProject / platforms / android / build.gradle, - Dorg.gradle.daemon =真 ERROR构建其中一个平台:错误:/ Users / desmondlai / Desktop / hairCorner / HairProject / platforms / android / cordova / build:命令失败,退出代码为1 您可能没有构建此项目所需的环境或操作系统 错误:/ Users / desmondlai / Desktop / hairCorner / HairProject / platforms / android / cordova / build:命令失败,退出代码为1
答案 0 :(得分:0)
添加/删除android并没有为我解决问题。
生成项目资源为我解决了这个问题。
ionic resources
答案 1 :(得分:0)
将xml名称空间xmlns:gap =“http://phonegap.com/ns/1.0”添加到config.xml
另外,如果您使用的是Linux,则必须先执行“sudo chmod 755 gradlew”才能执行“./gradlew clean”以确保它是可执行的
答案 2 :(得分:0)
删除您的图标文件夹splashscreen文件夹 然后按照这些命令
sudo npm install ionic-resources -g
离子资源android