Skip to content

Commit 7123a6e

Browse files
committed
android build: Target 64-bit architectures.
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.
1 parent b286d50 commit 7123a6e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

android/app/build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,6 @@ android {
116116
targetSdkVersion rootProject.ext.targetSdkVersion
117117
versionCode 122
118118
versionName "25.8.122"
119-
ndk {
120-
abiFilters "armeabi-v7a", "x86"
121-
}
122119
}
123120
compileOptions {
124121
sourceCompatibility JavaVersion.VERSION_1_8
@@ -147,7 +144,7 @@ android {
147144
reset()
148145
enable enableSeparateBuildPerCPUArchitecture
149146
universalApk false // If true, also generate a universal APK
150-
include "armeabi-v7a", "x86"
147+
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
151148
}
152149
}
153150
buildTypes {
@@ -169,7 +166,7 @@ android {
169166
variant.outputs.each { output ->
170167
// For each separate APK per architecture, set a unique version code as described here:
171168
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
172-
def versionCodes = ["armeabi-v7a":1, "x86":2]
169+
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
173170
def abi = output.getFilter(OutputFile.ABI)
174171
if (abi != null) { // null for the universal-debug, universal-release variants
175172
output.versionCodeOverride =

0 commit comments

Comments
 (0)