Many of our users – and I guess many of the PhoneGap Build users – face the problem of properly compile Android apps. Compiling for Android is pretty straight forward compared to iOS except when it comes to both ARM and x86 platforms.

How to know when you are facing this problem?

Generally, the problem appears when you access the Device catalog in the Google Play Console and that it shows you a ridiculous amount of devices your app is compatible with.

I won’t write an article about processor architectures but it’s good to know that Android supports different processor architectures, notably ARM and Intel (aka x86).

If you’re curious, you can read this article: ARM vs X86 – Key differences explained!.

While developing, you don’t sign your app and PhoneGap Build silently compiles it for ARM devices. It’s a good thing as the ARM architecture is far more widespread than x86. When ready, you sign your app, compile it and upload the APK file in the Google Play Console. This is when the problem appears. You check the Device Catalog and it tells you that your app is compatible with less than a thousand devices 😱.

The reason is that if you don’t sign your app, PhoneGap Build compiles it for ARM devices and when you sign it, it compiles it for x86 (ie. a very small fraction of the devices on the market). I know… Don’t ask me why.

The Solution

You’ll find many posts and threads about uploading multiple APK to support both ARM and x86. In this article, I’ll show you how to do it with WP-AppKit and PhoneGap Build. (Fair warning: I know it’s a tedious process but at the moment, we don’t have another solution.)

Please, remember that you don’t need to create multiple APK during the development phase and it only applies to Android apps. Also ensure that you use the latest version of WP-AppKit (1.1+).

Basically, we’re going to:

  • Set a specific VersionCode
  • Choose ARM as target architecture
  • Export the project .zip
  • Compile for ARM on PhoneGap Build
  • Increment the VersionCode
  • Choose x86 as target architecture
  • Export the project .zip
  • Compile for x86 on PhoneGap Build

At the end, you’ll have 2 APK files to upload in the Google Developer Console (ie. 2 versions) and the Device Catalog should give you a lot bigger number of supported devices.

Compile for ARM

  • Edit your app in WordPress
  • Scroll to the PhoneGap Build box
  • Set the VersionCode
  • Choose ARM as Target Architecture
  • Export the project .zip file

Compile for x86

  • Edit your app in WordPress
  • Scroll to the PhoneGap Build box
  • Set the VersionCode (it is mandatory to have a different VersionCode for ARM and x86 as they are going to be 2 different versions in Google Play Console)
  • Choose x86 as Target Architecture
  • Export the project .zip file

Compile each .zip as a different application in PhoneGap Build. At last, upload the 2 APK files as versions in the Google Play Console.

Mystery solved 🙂 Happy coding!

Published by Benjamin on August 4, 2017

Head of Digital for a press group, WordPress since 2008, WordCamp organizer, developer for the fun

Leave a Reply

Your email address will not be published. Required fields are marked *

Having questions?

FAQ | Tutorials | Documentation

Or

Contact Us