Been banging my head on this one for a while. This used to work but now it’s giving me this issue. I’ve tried:
./platforms/android/cordova/clean
removing android platform, clean, reinstall
removing / adding most recent plugin
Here’s the error I’m getting:
$ ionic build android
Updated the hooks directory to have execute permissions
Running command: "/Users/MeTheUser/Sites/TheSite/MyApp/hooks/after_prepare/010_add_platform_class.js" "/Users/MeTheUser/Sites/TheSite/MyApp/"
add to body class: platform-android
Running command: "/Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/cordova/build"
ANDROID_HOME=/Volumes/Mac/.android
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home
Running: /Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/gradlew cdvBuildDebug -b /Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/build.gradle -Dorg.gradle.daemon=true
:preBuild
:compileDebugNdk UP-TO-DATE
:preDebugBuild
:checkDebugManifest
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:preBuild
:CordovaLib:preDebugBuild
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:compileDebugJava UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:packageDebugJar UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:packageDebugJniLibs UP-TO-DATE
:CordovaLib:packageDebugLocalJar UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedDebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources
:processDebugManifest UP-TO-DATE
:processDebugResources/Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/build/intermediates/res/debug/values/values.xml:2: error: Error parsing XML: prefix must not be bound to one of the reserved namespace names
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:
/Volumes/Mac/.android/build-tools/21.1.2/aapt package -f --no-crunch -I /Volumes/Mac/.android/platforms/android-22/android.jar -M /Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/build/intermediates/res/debug -A /Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/build/intermediates/assets/debug -m -J /Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/build/generated/source/r/debug -F /Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package com.thecompany.theapp -0 apk --output-text-symbols /Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/build/intermediates/symbols/debug
Error Code:
1
Output:
/Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/build/intermediates/res/debug/values/values.xml:2: error: Error parsing XML: prefix must not be bound to one of the reserved namespace names
* 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: 16.044 secs
/Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/MeTheUser/Sites/TheSite/MyApp/platforms/android/build.gradle,-Dorg.gradle.daemon=true
ERROR building one of the platforms: Error: /Users/MeTheUser/Sites/TheSite/MyApp/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/MeTheUser/Sites/TheSite/MyApp/platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
Cordova CLI: 5.0.0
Ionic Version: 1.0.0-rc.2
Ionic CLI Version: 1.5.0
Ionic App Lib Version: 0.1.0
ios-deploy version: Not installed
ios-sim version: 3.1.1
OS: Mac OS X Yosemite
Node Version: v0.12.1
Xcode version: Xcode 6.3.1 Build version 6D1002
I upgraded the Android tools last night but I just checked the $ android sdk and there are three more updates. I’ll let you know what happens after I update.
Thanks @encodedmirko I had actually found that link before posting my question here. My values.xml lines were a little different but there was still a custom namespace that went unused. The issue is that whenever I run ionic build android again it recreates this file just as it was.
Here’s what the file looks like and you can see the offending line on 2 with xmlns:ns1="..."
Hmm, good clue. I removed the plugin then ran .platorms/android/cordova/clean but got the same crash on build and when I checked the values.xml it still had cordova residue in it. Do you think there’s a better strategy to try?
as further FYI here’s my plugin list after removing crashlytics:
Odd, it seemed that the ns1 namespace was only used by the crashlytics string. In fact here’s somebody else reporting a similar issue
Ah, the joys of xml. I’m out of ideas right now. Maybe do a global search inside the project and find where those values with the namespace come from, e.g. TypographyDashes.
What went wrong:
Execution failed for task ‘:CordovaLib:processDebugResources’.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Users\Keerthi\AppData\Local\Android\sdk\build-tools\23.0.1\aapt.exe package -f --no-crunch -I C:\Users\Keerthi\AppData\Local\Android\sdk\platforms\android-23\android.jar -M C:\Windows\System32\myapp\platforms\android\CordovaLib\build\intermediates\bundles\debug\AndroidManifest.xml -S C:\Windows\System32\myapp\platforms\android\CordovaLib\build\intermediates\bundles\debug\res -A C:\Windows\System32\myapp\platforms\android\CordovaLib\build\intermediates\bundles\debug\assets -m -J C:\Windows\System32\myapp\platforms\android\CordovaLib\build\generated\source\r\debug --debug-mode --custom-package org.apache.cordova --non-constant-id -0 apk --output-text-symbols C:\Windows\System32\myapp\platforms\android\CordovaLib\build\intermediates\bundles\debug
Error Code:
1
Output:
ERROR: asset directory ‘C:\Windows\System32\myapp\platforms\android\CordovaLib\build\intermediates\bundles\debug\assets’ does not exist
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: 2.784 secs
C:\Windows\System32\myapp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c “C:\Windows\System32\myapp\platforms\android\gradlew cdvBuildDebug -b C:\Windows\System32\myapp\platforms\android\build.gradle -Dorg.gradle.daemon=true”
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\Keerthi\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:139:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:817:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
This was caused because of permissions on folder for me. Application was not able to create the assets folder. I gave full permissions to the android sdk folder. Then it started working.
I need help , my application gives me error to build the apk, thank you
Native thread-sleep not available.
This will result in much slower performance, but it will still work.
You should re-install spawn-sync or upgrade to the lastest version of node if possible.
Check /usr/lib/node_modules/ionic/node_modules/ionic-app-lib/node_modules/cross-spawn/node_modules/spawn-sync/error.log for more details
Running command: /var/www/html/appLaca/hooks/after_prepare/010_add_platform_class.js /var/www/html/appLaca
add to body class: platform-android
ANDROID_HOME=/home/jcoreas/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
:preBuild UP-TO-DATE
:preReleaseBuild UP-TO-DATE
:checkReleaseManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preReleaseBuild UP-TO-DATE
:CordovaLib:compileReleaseNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyReleaseLint UP-TO-DATE
:CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
:CordovaLib:packageReleaseRenderscript UP-TO-DATE
:CordovaLib:checkReleaseManifest
:CordovaLib:prepareReleaseDependencies
:CordovaLib:compileReleaseRenderscript UP-TO-DATE
:CordovaLib:generateReleaseResValues UP-TO-DATE
:CordovaLib:generateReleaseResources UP-TO-DATE
:CordovaLib:packageReleaseResources UP-TO-DATE
:CordovaLib:compileReleaseAidl UP-TO-DATE
:CordovaLib:generateReleaseBuildConfig UP-TO-DATE
:CordovaLib:generateReleaseAssets UP-TO-DATE
:CordovaLib:mergeReleaseAssets UP-TO-DATE
:CordovaLib:processReleaseManifest UP-TO-DATE
:CordovaLib:processReleaseResources UP-TO-DATE
:CordovaLib:generateReleaseSources UP-TO-DATE
:CordovaLib:compileReleaseJavaWithJavac UP-TO-DATE
:CordovaLib:processReleaseJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:CordovaLib:mergeReleaseJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:CordovaLib:bundleRelease UP-TO-DATE
:prepareAndroidCordovaLibUnspecifiedReleaseLibrary UP-TO-DATE
:prepareReleaseDependencies
:compileReleaseAidl UP-TO-DATE
:compileReleaseRenderscript UP-TO-DATE
:generateReleaseBuildConfig UP-TO-DATE
:generateReleaseAssets UP-TO-DATE
:mergeReleaseAssets UP-TO-DATE
:generateReleaseResValues UP-TO-DATE
:generateReleaseResources UP-TO-DATE
:mergeReleaseResources UP-TO-DATE
:processReleaseManifest UP-TO-DATE
:processReleaseResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ‘:processReleaseResources’.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘/home/jcoreas/Android/Sdk/build-tools/23.0.3/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: 1.959 secs
Error: Error code 1 for command: /var/www/html/appLaca/platforms/android/gradlew with args: cdvBuildRelease,-b,/var/www/html/appLaca/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true