Using ionic to build android app :
[root@localhost ionic-app-base-master]# ionic build android
Console log show those messages :
Running command: /root/ionic-tutorial/conference/ionic-app-base-master/hooks/after_prepare/010_add_platform_class.js /root/ionic-tutorial/conference/ionic-app-base-master
add to body class: platform-android
ANDROID_HOME=/usr/local/lib/android-sdk
JAVA_HOME=/usr/java/jdk1.8.0_45
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':CordovaLib:processDebugResources'.
> A problem occurred starting process 'command '/usr/local/lib/android-sdk/build-tools/23.0.2/aapt''
* 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.503 secs
Error: Error code 1 for command: /root/ionic-tutorial/conference/ionic-app-base-master/platforms/android/gradlew with args: cdvBuildDebug,-b,/root/ionic-tutorial/conference/ionic-app-base-master/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
I check many tickets & i perform many changes , like :
https://stackoverflow.com/a/30842231/747579
Conflict with android support version on cordova build android
https://forum.ionicframework.com/t/ionic-android-build-problem/29131/5
Known that the current config.xml
is :
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ionicframework.starter" 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">
<name>HelloCordova</name>
<description>
An Ionic Framework and Cordova project.
</description>
<author email="me@abdennoor.com" href="http://abdennoor.com">
Abdennour TOUMI
</author>
<content src="index.html" />
<access origin="*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<!-- Ionic supports Android Jellybean and up -->
<preference name="android-minSdkVersion" value="16" />
<!-- Don't store local data in an iCloud backup. Turn this to "cloud" to enable storage
to be sent to iCloud. Note: enabling this could result in Apple rejecting your app.
-->
<preference name="BackupWebStorage" value="none" />
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
</widget>
My Environment :
Android SDK : 23.1.0
Ionic : 1.7.4
Cordova : 6.1.0
gradle : 2.2.1
JVM : 1.8.0_45 (Oracle Corporation 25.45-b02)
Groovy : 2.3.6
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
OS: Linux 3.10.0-327.10.1.el7.x86_64 amd64