@@ -120,13 +120,15 @@ def jscFlavor = 'org.webkit:android-jsc:+'
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,7 +196,7 @@ 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} " ) {
@@ -215,7 +223,7 @@ dependencies {
215223// Run this once to be able to run the application with BUCK
216224// puts all compile dependencies into folder libs for BUCK to use
217225task copyDownloadableDepsToLibs (type : Copy ) {
218- from configurations. compile
226+ from configurations. implementation
219227 into ' libs'
220228}
221229
0 commit comments