Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I publish to play store the x86 and ARM apks of my cordova-crosswalk app?

My app is developped/published with Cordova and Crosswalk. Crosswalk generates an apk for ARM cpus and another one for x86 cpus.

At the moment, when I upload my ARM apk to the play store and then try to upload the x86 one, it prevents me from doing so and display a message that says that I cannot have two apk with the same version code.

It seems it's possible to upload on the play store multiple apk files for the same version of an application byt filtering the devices targetted by each apk file.

However, it seems to require the use of an "Application.mk" file that the Cordova project structure doesn't seem to have by default.

How can I include an Application.mk file within my apks so that both the ARM and the x86 with the same version code will be uploadable to the Play store ?

like image 731
Żabojad Avatar asked Feb 24 '15 21:02

Żabojad


Video Answer


2 Answers

It's absolutily possible. This feature receve the name of: Multiple APK

You don't need to use the 'Application.mk'

The process is simple:

  1. In Developer Console, switch to Advanced Mode (click the Switch to advanced mode button at the top right of the APK tab - note that you must have uploaded at least one APK for that button to appear)
  2. Upload the two APK
  3. Publish!

There's some rules to use multiple APK, but if you use the files generated by cordova crosswalk, you have nothing to worry about.

The problem that you described with version code, happens beacuse each app must have a different version code. In my case, I use ionic framework (extends cordova) and in the build process, it generated a diferent version code por each apk, so I had no problem. If it not happens for you, you can try to change de android:versionCode directly on the AndroidManifest.xml file. Here is how my manifest looks like:

<manifest 
  android:hardwareAccelerated="true" 
  android:versionCode="102" 
  android:versionName="0.1.2" 
  package="br.org.yyyyyyy.xxxxxxxxxx"   
  xmlns:android="http://schemas.android.com/apk/res/android">

In my case, the arm7 apk, the

android:versionCode="102"

And in x86 apk the

android:versionCode="104"

References:

Android Multiple APKs DOC

Maintaining Multiple APKs DOC

like image 64
Henry Ávila Avatar answered Oct 21 '22 08:10

Henry Ávila


I`m doing simple way. Example your main v code is 102, so you build first arm with 102 v code, and upload. Until upload runs, you can go change v code in manifest and in build grade to 103 and build another one x86. Easy and simple.

like image 23
Ponas Paslaptis r3L4x Avatar answered Oct 21 '22 08:10

Ponas Paslaptis r3L4x