Introduction
This tip will take you through steps which are required to make a single Android build instead of separate armv7 and x86 builds.
Background
When ionic/cordova developers add crosswalk plugin to their project, then two separate builds are created. One for armv7 and other for x86. But some developers do not want that, and they try to make only one combined build which can run on both architectures. This tip will help them in doing this.
Steps
(NOTE: Before you follow these steps, remove platform folder and install again.)
Here are the steps to do that:
Make a file build-extras.gradle and put it into platforms/android/. Add the following line to file you just created:
cdvBuildMultipleApks=false
Now run ionic run android
command, it will create combined single build android-debug.apk.
build.gradle
will automatically import build-extras.gradle
, if that is defined. You can see code of build.gradle
doing this:
def hasBuildExtras = file('build-extras.gradle').exists()
if (hasBuildExtras) {
apply from: 'build-extras.gradle'
}
Points of Interest
These instructions are clearly mentioned in platforms/android/build.gradle line 57:
Configuration properties. Set these via environment variables, build-extras.gradle
, or gradle.properties
.
NOTE: Before you follow these steps, remove platform folder and install again.