@@ -114,19 +114,21 @@ def jscFlavor = 'org.webkit:android-jsc:+'
114114/**
115115 * Whether to enable the Hermes VM.
116116 *
117- * This should be set on project.ext.react and mirrored here. If it is not set
117+ * This should be set on project.ext.react and that value will be read here. If it is not set
118118 * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
119119 * and the benefits of using Hermes will therefore be sharply reduced.
120120 */
121121def enableHermes = project. ext. react. get(" enableHermes" , false );
122122
123+ /**
124+ * Architectures to build native code for in debug.
125+ */
126+ def nativeArchitectures = project. getProperties(). get(" reactNativeDebugArchitectures" )
127+
123128android {
124- compileSdkVersion rootProject. ext. compileSdkVersion
129+ ndkVersion rootProject. ext. ndkVersion
125130
126- compileOptions {
127- sourceCompatibility JavaVersion . VERSION_1_8
128- targetCompatibility JavaVersion . VERSION_1_8
129- }
131+ compileSdkVersion rootProject. ext. compileSdkVersion
130132
131133 defaultConfig {
132134 applicationId " com.example"
@@ -154,6 +156,11 @@ android {
154156 buildTypes {
155157 debug {
156158 signingConfig signingConfigs. debug
159+ if (nativeArchitectures) {
160+ ndk {
161+ abiFilters nativeArchitectures. split(' ,' )
162+ }
163+ }
157164 }
158165 release {
159166 // Caution! In production, you need to generate your own keystore file.
@@ -169,11 +176,12 @@ android {
169176 variant. outputs. each { output ->
170177 // For each separate APK per architecture, set a unique version code as described here:
171178 // https://developer.android.com/studio/build/configure-apk-splits.html
179+ // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
172180 def versionCodes = [" armeabi-v7a" : 1 , " x86" : 2 , " arm64-v8a" : 3 , " x86_64" : 4 ]
173181 def abi = output. getFilter(OutputFile . ABI )
174182 if (abi != null ) { // null for the universal-debug, universal-release variants
175183 output. versionCodeOverride =
176- versionCodes . get(abi) * 1048576 + defaultConfig . versionCode
184+ defaultConfig . versionCode * 1000 + versionCodes . get(abi)
177185 }
178186
179187 }
@@ -188,11 +196,12 @@ dependencies {
188196 implementation " androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
189197
190198 debugImplementation(" com.facebook.flipper:flipper:${ FLIPPER_VERSION} " ) {
191- exclude group :' com.facebook.fbjni'
199+ exclude group :' com.facebook.fbjni'
192200 }
193201
194202 debugImplementation(" com.facebook.flipper:flipper-network-plugin:${ FLIPPER_VERSION} " ) {
195203 exclude group :' com.facebook.flipper'
204+ exclude group :' com.squareup.okhttp3' , module :' okhttp'
196205 }
197206
198207 debugImplementation(" com.facebook.flipper:flipper-fresco-plugin:${ FLIPPER_VERSION} " ) {
@@ -211,7 +220,7 @@ dependencies {
211220// Run this once to be able to run the application with BUCK
212221// puts all compile dependencies into folder libs for BUCK to use
213222task copyDownloadableDepsToLibs (type : Copy ) {
214- from configurations. compile
223+ from configurations. implementation
215224 into ' libs'
216225}
217226
0 commit comments