Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Hosted-services / Cordova

Building Combined armv7 / x86 apk After Crosswalk Integration in an Cordova / Ionic Project

5.00/5 (1 vote)
12 Sep 2015CPOL 19K  
Steps to build combined armv7 / x86 Android .apk after adding crosswalk

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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)