@@ -15,10 +15,12 @@ import com.android.build.OutputFile
15
15
* // the name of the generated asset file containing your JS bundle
16
16
* bundleAssetName: "index.android.bundle",
17
17
*
18
- * // the entry file for bundle generation
18
+ * // the entry file for bundle generation. If none specified and
19
+ * // "index.android.js" exists, it will be used. Otherwise "index.js" is
20
+ * // default. Can be overridden with ENTRY_FILE environment variable.
19
21
* entryFile: "index.android.js",
20
22
*
21
- * // https://facebook.github.io/react-native /docs/performance#enable-the-ram-format
23
+ * // https://reactnative.dev /docs/performance#enable-the-ram-format
22
24
* bundleCommand: "ram-bundle",
23
25
*
24
26
* // whether to bundle JS and assets in debug mode
@@ -37,7 +39,7 @@ import com.android.build.OutputFile
37
39
* // bundleInBeta: true,
38
40
*
39
41
* // whether to disable dev mode in custom build variants (by default only disabled in release)
40
- * // for AppleAuthExample : to disable dev mode in the staging build type (if configured)
42
+ * // for example : to disable dev mode in the staging build type (if configured)
41
43
* devDisabledInStaging: true,
42
44
* // The configuration property can be in the following formats
43
45
* // 'devDisabledIn${productFlavor}${buildType}'
@@ -64,7 +66,7 @@ import com.android.build.OutputFile
64
66
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
65
67
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
66
68
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
67
- * // for AppleAuthExample , you might want to remove it from here.
69
+ * // for example , you might want to remove it from here.
68
70
* inputExcludes: ["android/**", "ios/**"],
69
71
*
70
72
* // override which node gets called and with what additional arguments
@@ -99,7 +101,7 @@ def enableProguardInReleaseBuilds = false
99
101
/**
100
102
* The preferred build flavor of JavaScriptCore.
101
103
*
102
- * For AppleAuthExample , to use the international variant, you can use:
104
+ * For example , to use the international variant, you can use:
103
105
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
104
106
*
105
107
* The international variant includes ICU i18n library and necessary data
@@ -112,19 +114,21 @@ def jscFlavor = 'org.webkit:android-jsc:+'
112
114
/**
113
115
* Whether to enable the Hermes VM.
114
116
*
115
- * 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
116
118
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
117
119
* and the benefits of using Hermes will therefore be sharply reduced.
118
120
*/
119
121
def enableHermes = project. ext. react. get(" enableHermes" , false );
120
122
123
+ /**
124
+ * Architectures to build native code for in debug.
125
+ */
126
+ def nativeArchitectures = project. getProperties(). get(" reactNativeDebugArchitectures" )
127
+
121
128
android {
122
- compileSdkVersion rootProject. ext. compileSdkVersion
129
+ ndkVersion rootProject. ext. ndkVersion
123
130
124
- compileOptions {
125
- sourceCompatibility JavaVersion . VERSION_1_8
126
- targetCompatibility JavaVersion . VERSION_1_8
127
- }
131
+ compileSdkVersion rootProject. ext. compileSdkVersion
128
132
129
133
defaultConfig {
130
134
applicationId " com.example.reactnativeappleauth"
@@ -152,52 +156,54 @@ android {
152
156
buildTypes {
153
157
debug {
154
158
signingConfig signingConfigs. debug
159
+ if (nativeArchitectures) {
160
+ ndk {
161
+ abiFilters nativeArchitectures. split(' ,' )
162
+ }
163
+ }
155
164
}
156
165
release {
157
166
// Caution! In production, you need to generate your own keystore file.
158
- // see https://facebook.github.io/react-native /docs/signed-apk-android.
167
+ // see https://reactnative.dev /docs/signed-apk-android.
159
168
signingConfig signingConfigs. debug
160
169
minifyEnabled enableProguardInReleaseBuilds
161
170
proguardFiles getDefaultProguardFile(" proguard-android.txt" ), " proguard-rules.pro"
162
171
}
163
172
}
173
+
164
174
// applicationVariants are e.g. debug, release
165
175
applicationVariants. all { variant ->
166
176
variant. outputs. each { output ->
167
177
// For each separate APK per architecture, set a unique version code as described here:
168
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.
169
180
def versionCodes = [" armeabi-v7a" : 1 , " x86" : 2 , " arm64-v8a" : 3 , " x86_64" : 4 ]
170
181
def abi = output. getFilter(OutputFile . ABI )
171
182
if (abi != null ) { // null for the universal-debug, universal-release variants
172
183
output. versionCodeOverride =
173
- versionCodes . get(abi) * 1048576 + defaultConfig . versionCode
184
+ defaultConfig . versionCode * 1000 + versionCodes . get(abi)
174
185
}
175
186
176
187
}
177
188
}
178
-
179
- packagingOptions {
180
- pickFirst " lib/armeabi-v7a/libc++_shared.so"
181
- pickFirst " lib/arm64-v8a/libc++_shared.so"
182
- pickFirst " lib/x86/libc++_shared.so"
183
- pickFirst " lib/x86_64/libc++_shared.so"
184
- }
185
189
}
186
190
187
191
dependencies {
188
192
implementation fileTree(dir : " libs" , include : [" *.jar" ])
189
193
// noinspection GradleDynamicVersion
190
194
implementation " com.facebook.react:react-native:+" // From node_modules
191
195
192
-
193
196
implementation " androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
197
+
194
198
debugImplementation(" com.facebook.flipper:flipper:${ FLIPPER_VERSION} " ) {
195
- exclude group :' com.facebook.fbjni'
199
+ exclude group :' com.facebook.fbjni'
196
200
}
201
+
197
202
debugImplementation(" com.facebook.flipper:flipper-network-plugin:${ FLIPPER_VERSION} " ) {
198
203
exclude group :' com.facebook.flipper'
199
204
exclude group :' com.squareup.okhttp3' , module :' okhttp'
200
205
}
206
+
201
207
debugImplementation(" com.facebook.flipper:flipper-fresco-plugin:${ FLIPPER_VERSION} " ) {
202
208
exclude group :' com.facebook.flipper'
203
209
}
@@ -210,14 +216,14 @@ dependencies {
210
216
implementation jscFlavor
211
217
}
212
218
213
- implementation project(' :reactnativeappleauth' )
219
+ // implementation project(':reactnativeappleauth')
214
220
}
215
221
216
222
// Run this once to be able to run the application with BUCK
217
223
// puts all compile dependencies into folder libs for BUCK to use
218
224
task copyDownloadableDepsToLibs (type : Copy ) {
219
- from configurations. compile
225
+ from configurations. implementation
220
226
into ' libs'
221
227
}
222
228
223
- apply from : file(" ../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle" ); applyNativeModulesAppBuildGradle(project)
229
+ apply from : file(" ../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle" ); applyNativeModulesAppBuildGradle(project)
0 commit comments