Click here to Skip to main content
15,891,670 members
Articles / Hosted Services / Cordova
Tip/Trick

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

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
12 Sep 2015CPOL 18.6K   1
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)


Written By
Software Developer
Pakistan Pakistan
I am an energetic software engineer specialized in Web and Hybrid Mobile applications development. A good team worker and always looking for interesting problems to solve. Specialties: Ionic, Cordova, AngularJS, PhoneGap, HTML5, MySQL, Jquery.

You can find my helpful posts at stackoverflow: http://stackoverflow.com/users/1517917/mudasser-ajaz

Comments and Discussions

 
Question"Error: Failed to install apk to device" has occurred on android version 6 Pin
Member 1213321422-Jun-17 18:08
Member 1213321422-Jun-17 18:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.