Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ionic build android failure - Execution failed for task processDebugResources

I am using Mac Yosemite. Getting the following failure on running a build for android platform :

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/sairamk/Development/android-sdk-macosx/build-tools/22.0.1/aapt package -f --no-crunch -I /Users/sairamk/Development/android-sdk-macosx/platforms/android-22/android.jar -M /Users/sairamk/projects/dummy_app/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /Users/sairamk/projects/dummy_app/platforms/android/build/intermediates/res/debug -A /Users/sairamk/projects/dummy_app/platforms/android/build/intermediates/assets/debug -m -J /Users/sairamk/projects/dummy_app/platforms/android/build/generated/source/r/debug -F /Users/sairamk/projects/dummy_app/platforms/android/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package com.ionicframework.bcgsandbox553389 -0 apk --output-text-symbols /Users/sairamk/projects/dummy_app/platforms/android/build/intermediates/symbols/debug
  Error Code:
    1
  Output:
    /Users/sairamk/projects/dummy_app/platforms/android/build/intermediates/res/debug/xml/config.xml:59: error: Error parsing XML: unbound prefix

The build runs perfectly fine for IOS. I have installed android SDK and configured ANDROID_HOME and ANDROID_SDK_ROOT system variables.

Also tried removing the platform and adding it again, to have a clean platform folder using :

ionic platform remove android
ionic platform add android

But no good.

Android SDK build tool versions that I have installed - 19.1,20,21.1.2 and 22.0.1

AndroidManifest.xml preference :

 <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22" />
like image 976
Sairam Krish Avatar asked Jun 04 '15 14:06

Sairam Krish


6 Answers

To get more info to debug this go in to the ./platforms/android/ folder and run:

Mac users:

gradlew --info build clean

Linux users (thanks Pierre):

./gradlew --info build clean

Windows users:

gradlew.bat --info build clean

This gives you a lot more detail.

My issue was solved this way, found some files that where incorrectly dropped into the project folder with spaces in the file names.

like image 195
CapeCoder Avatar answered Oct 22 '22 11:10

CapeCoder


This issue gets resolved by adding xml namespace for phonegap (xmlns:gap="http://phonegap.com/ns/1.0") to config.xml

After adding :

<widget id="com.ionicframework.yourpackagename" 
version="0.0.1" 
xmlns="http://www.w3.org/ns/widgets" 
xmlns:cdv="http://cordova.apache.org/ns/1.0"
xmlns:gap="http://phonegap.com/ns/1.0">

Hope it helps someone facing similar issue.

like image 41
Sairam Krish Avatar answered Oct 22 '22 11:10

Sairam Krish


from ionic forum

It was because of the "ionic resource" service error.

where run "ionic resource" command, I looked into and checked the /resources/android/splash folder, I clicked and open all of these png files, I found some pictures were broken(which appears as half of it).

So I replace these broken png files with the "normal" png file(at the same folder), then run "ionic build" command, the error is disappeared.

https://forum.ionicframework.com/t/ionic-android-build-problem/29131/7?u=bleuscyther

like image 33
Jeffrey Nicholson Carré Avatar answered Oct 22 '22 11:10

Jeffrey Nicholson Carré


But in my case, It resolved by removing the below line

    <gap:plugin name="nl.x-services.plugins.socialsharing" />

from my config.xml file

like image 35
newari Avatar answered Oct 22 '22 11:10

newari


I've got a similar issue. To find a workaround, I've created a new blank project. The compilation and emulation was good. I figure out there were a problem in my www folder. After some multiples test, one of my picture got that name : 'Clément.png". Removing the accent to get 'Clement.png' just fixed my problem.... A lot of pain.

like image 30
C0ZEN Avatar answered Oct 22 '22 11:10

C0ZEN


If you are developing with Windows, it may be because of the "path name". Windows doesn't allow the path name longer than 260 char. So making it shorter may solve it.

like image 37
Alperzkn Avatar answered Oct 22 '22 11:10

Alperzkn