Skip to content

Commit 0a2825f

Browse files
gengjiawenfacebook-github-bot
authored andcommitted
add x86_64 arm64-v8a support. Fixes #2814 (#18754)
Summary: add arm64 support, related issue : #2814. If we are okay with binary aar android-jsc, then the pr can be directly merged. Otherwise merge facebookarchive/android-jsc#30 first and do a new release. RNTester all variant works. You can also test the apk from here: https://github.com/gengjiawen/react-native/releases/tag/v0.56beta. facebookarchive/android-jsc#30. [ANDROID] [ENHANCEMENT] [ABI] - add x86_64 arm64-v8a support. Differential Revision: D9491481 Pulled By: hramos fbshipit-source-id: d6ec6992768eb0c0866a0317273e09fae5b8935e
1 parent ef863c0 commit 0a2825f

File tree

8 files changed

+12
-28
lines changed

8 files changed

+12
-28
lines changed

RNTester/android/app/build.gradle

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ apply from: "../../../react.gradle"
7676
* Upload all the APKs to the Play Store and people will download
7777
* the correct one based on the CPU architecture of their device.
7878
*/
79-
def enableSeparateBuildPerCPUArchitecture = false
79+
def enableSeparateBuildPerCPUArchitecture = true
8080

8181
/**
8282
* Run Proguard to shrink the Java bytecode in release builds.
@@ -93,9 +93,6 @@ android {
9393
targetSdkVersion 27
9494
versionCode 1
9595
versionName "1.0"
96-
ndk {
97-
abiFilters "armeabi-v7a", "x86"
98-
}
9996
}
10097
signingConfigs {
10198
release {
@@ -110,7 +107,7 @@ android {
110107
enable enableSeparateBuildPerCPUArchitecture
111108
universalApk false
112109
reset()
113-
include "armeabi-v7a", "x86"
110+
include "armeabi-v7a", "x86", "x86_64", "arm64-v8a"
114111
}
115112
}
116113
buildTypes {
@@ -123,20 +120,6 @@ android {
123120
signingConfig signingConfigs.release
124121
}
125122
}
126-
127-
// applicationVariants are e.g. debug, release
128-
applicationVariants.all { variant ->
129-
variant.outputs.each { output ->
130-
// For each separate APK per architecture, set a unique version code as described here:
131-
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
132-
def versionCodes = ["armeabi-v7a":1, "x86":2]
133-
def abi = output.getFilter(OutputFile.ABI)
134-
if (abi != null) { // null for the universal-debug, universal-release variants
135-
output.versionCodeOverride =
136-
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
137-
}
138-
}
139-
}
140123
}
141124

142125
dependencies {

ReactAndroid/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ dependencies {
304304
api "com.squareup.okhttp3:okhttp:${OKHTTP_VERSION}"
305305
api "com.squareup.okhttp3:okhttp-urlconnection:${OKHTTP_VERSION}"
306306
api 'com.squareup.okio:okio:1.14.0'
307-
compile 'org.webkit:android-jsc:r174650'
307+
compile project(':android-jsc')
308308

309309
testImplementation "junit:junit:${JUNIT_VERSION}"
310310
testImplementation "org.powermock:powermock-api-mockito:${POWERMOCK_VERSION}"

ReactAndroid/src/main/jni/Application.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
APP_BUILD_SCRIPT := Android.mk
22

3-
APP_ABI := armeabi-v7a x86
3+
APP_ABI := armeabi-v7a x86 arm64-v8a x86_64
44
APP_PLATFORM := android-16
55

66
APP_MK_DIR := $(dir $(lastword $(MAKEFILE_LIST)))

ReactAndroid/src/main/jni/third-party/double-conversion/Android.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
1919
CXX11_FLAGS := -Wno-unused-variable -Wno-unused-local-typedefs
2020
LOCAL_CFLAGS += $(CXX11_FLAGS)
2121

22-
include $(BUILD_STATIC_LIBRARY)
22+
include $(BUILD_STATIC_LIBRARY)

android-jsc/android-jsc.aar

7.97 MB
Binary file not shown.

android-jsc/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
configurations.maybeCreate("default")
2+
artifacts.add("default", file('android-jsc.aar'))

local-cli/templates/HelloWorld/android/app/build.gradle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,13 @@ android {
103103
targetSdkVersion rootProject.ext.targetSdkVersion
104104
versionCode 1
105105
versionName "1.0"
106-
ndk {
107-
abiFilters "armeabi-v7a", "x86"
108-
}
109106
}
110107
splits {
111108
abi {
112109
reset()
113110
enable enableSeparateBuildPerCPUArchitecture
114111
universalApk false // If true, also generate a universal APK
115-
include "armeabi-v7a", "x86"
112+
include "armeabi-v7a", "x86", "arm64-v8a"
116113
}
117114
}
118115
buildTypes {
@@ -126,7 +123,7 @@ android {
126123
variant.outputs.each { output ->
127124
// For each separate APK per architecture, set a unique version code as described here:
128125
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
129-
def versionCodes = ["armeabi-v7a":1, "x86":2]
126+
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3]
130127
def abi = output.getFilter(OutputFile.ABI)
131128
if (abi != null) { // null for the universal-debug, universal-release variants
132129
output.versionCodeOverride =

settings.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
// This source code is licensed under the MIT license found in the
44
// LICENSE file in the root directory of this source tree.
55

6-
include ':ReactAndroid', ':RNTester:android:app'
6+
include ':ReactAndroid'
7+
include ':RNTester:android:app'
8+
include ':android-jsc'

0 commit comments

Comments
 (0)