Skip to content

Commit

Permalink
android build: Target 64-bit architectures.
Browse files Browse the repository at this point in the history
This fixes #3323, meeting the Google Play 64-bit requirement that
comes into effect next week, 2019-08-01 -- in other words, it makes it
possible for us to continue uploading new releases after that date.

Aside from ticking a box, it's expected to improve performance on
devices with 64-bit CPUs -- which is most new devices of the last few
years, and 85% of all our installs on active devices as reported by
the Play Console.  (In "Release management > Device catalog",
filtering "ABI" to `arm64-v8a` or `x86_64`.)

The main work to make this possible happened in RN upstream; we pulled
it in with our upgrade to RN v0.59, #3399.  This is one last fragment
of the diff in upstream's template app between those versions,
enabling 64-bit versions in our build config.

One unfortunate regression this causes: we're still distributing a
single APK for all architectures, and so adding 64-bit architectures
makes it a lot bigger.  At a quick estimate from comparing
`yarn build:android-nokeys` before and after, we go from 13MB to 22MB.

The Play Store has had a solution to that for a while now, called
"Android App Bundle".  We should switch to that.  We're already
tracking that task as #3547, and this change increases its priority.
  • Loading branch information
gnprice committed Jul 25, 2019
1 parent b286d50 commit 7123a6e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ android {
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 122
versionName "25.8.122"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -147,7 +144,7 @@ android {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
buildTypes {
Expand All @@ -169,7 +166,7 @@ android {
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
Expand Down

0 comments on commit 7123a6e

Please sign in to comment.