@@ -120,13 +120,15 @@ def jscFlavor = 'org.webkit:android-jsc:+'
120
120
*/
121
121
def enableHermes = project. ext. react. get(" enableHermes" , false );
122
122
123
+ /**
124
+ * Architectures to build native code for in debug.
125
+ */
126
+ def nativeArchitectures = project. getProperties(). get(" reactNativeDebugArchitectures" )
127
+
123
128
android {
124
- compileSdkVersion rootProject. ext. compileSdkVersion
129
+ ndkVersion rootProject. ext. ndkVersion
125
130
126
- compileOptions {
127
- sourceCompatibility JavaVersion . VERSION_1_8
128
- targetCompatibility JavaVersion . VERSION_1_8
129
- }
131
+ compileSdkVersion rootProject. ext. compileSdkVersion
130
132
131
133
defaultConfig {
132
134
applicationId " com.example"
@@ -154,6 +156,11 @@ android {
154
156
buildTypes {
155
157
debug {
156
158
signingConfig signingConfigs. debug
159
+ if (nativeArchitectures) {
160
+ ndk {
161
+ abiFilters nativeArchitectures. split(' ,' )
162
+ }
163
+ }
157
164
}
158
165
release {
159
166
// Caution! In production, you need to generate your own keystore file.
@@ -169,11 +176,12 @@ android {
169
176
variant. outputs. each { output ->
170
177
// For each separate APK per architecture, set a unique version code as described here:
171
178
// https://developer.android.com/studio/build/configure-apk-splits.html
179
+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
172
180
def versionCodes = [" armeabi-v7a" : 1 , " x86" : 2 , " arm64-v8a" : 3 , " x86_64" : 4 ]
173
181
def abi = output. getFilter(OutputFile . ABI )
174
182
if (abi != null ) { // null for the universal-debug, universal-release variants
175
183
output. versionCodeOverride =
176
- versionCodes . get(abi) * 1048576 + defaultConfig . versionCode
184
+ defaultConfig . versionCode * 1000 + versionCodes . get(abi)
177
185
}
178
186
179
187
}
@@ -188,7 +196,7 @@ dependencies {
188
196
implementation " androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
189
197
190
198
debugImplementation(" com.facebook.flipper:flipper:${ FLIPPER_VERSION} " ) {
191
- exclude group :' com.facebook.fbjni'
199
+ exclude group :' com.facebook.fbjni'
192
200
}
193
201
194
202
debugImplementation(" com.facebook.flipper:flipper-network-plugin:${ FLIPPER_VERSION} " ) {
@@ -215,7 +223,7 @@ dependencies {
215
223
// Run this once to be able to run the application with BUCK
216
224
// puts all compile dependencies into folder libs for BUCK to use
217
225
task copyDownloadableDepsToLibs (type : Copy ) {
218
- from configurations. compile
226
+ from configurations. implementation
219
227
into ' libs'
220
228
}
221
229
0 commit comments