2
votes

All the things happened after I made several commands for the ionic App with ngCordova - ionic start "App Project Name" - ionic platform add android - ionic build 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'?)

ERROR: unable to process assets while packaging '/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_' ERROR: packaging of '/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_' failed FAILED

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':processDebugResources'.

    com.android.ide.common.internal.LoggedErrorException: Failed to run command: /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 Error Code: 1 Output: 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'?) ERROR: unable to process assets while packaging '/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_' ERROR: packaging of '/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build/intermediates/res/resources-debug.ap_' failed

  • 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: 45.169 secs

/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/cordova/node_modules/q/q.js:126 throw e; ^ Error code 1 for command: /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/build.gradle,-Dorg.gradle.daemon=true ERROR building one of the platforms: Error: /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/cordova/build: Command failed with exit code 1 You may not have the required environment or OS to build this project Error: /Users/desmondlai/Desktop/hairCorner/HairProject/platforms/android/cordova/build: Command failed with exit code 1

3
maybe try and remove the android platform and then add it back again? Is it a blank project? or have you already started playing around with the code and config files? - SM3RKY
tried this already ionic platform rm android ionic rm platform rm ios ionic add platform add android ionic add platform add ios I already hv existing project, I succeeded to build the app as apk file BUT failed when I wanna create an updated version. I tried to copy the main directory folder to a new path and start create project again, but the error seems still exist. It seems to be the problem is inside my project. Is this related to the plugins ? I used some Angular modules and lots of Grunt - Desmond Lai

3 Answers

0
votes

Add/remove android didn't fix the problem for me either.

Generating the project resources fixed the issue for me.

ionic resources 
0
votes

Add xml namespace xmlns:gap="http://phonegap.com/ns/1.0" to your config.xml

also, if you are using linux you must do "sudo chmod 755 gradlew" before you do the "./gradlew clean" to make sure it is executable

0
votes

delete your icon folder splashscreen folder then follow these commands

sudo npm install ionic-resources -g
ionic resources android