@@ -79,13 +79,15 @@ import com.sun.org.apache.xalan.internal.xsltc.compiler.Copy
79
79
project. ext. react = [
80
80
nodeExecutableAndArgs : [" node" , " --max-old-space-size=16384" ],
81
81
entryFile : " index.android.js" ,
82
+ enableHermes : false , // clean and rebuild if changing
82
83
bundleInPr : true ,
83
84
inputExcludes : [" android/**" , " ios/**" , " react-native/**" , " src/**" , " test/**" ]
84
85
]
85
86
86
- configurations. all {
87
- exclude group : ' com.facebook.react' , module : ' react-native'
88
- }
87
+ // NOTE: Uncomment if building RN from a fork
88
+ // configurations.all {
89
+ // exclude group: 'com.facebook.react', module: 'react-native'
90
+ // }
89
91
90
92
apply from : " ../../node_modules/react-native/react.gradle"
91
93
@@ -104,6 +106,28 @@ def enableSeparateBuildPerCPUArchitecture = false
104
106
*/
105
107
def enableProguardInReleaseBuilds = false
106
108
109
+ /**
110
+ * The preferred build flavor of JavaScriptCore.
111
+ *
112
+ * For example, to use the international variant, you can use:
113
+ * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
114
+ *
115
+ * The international variant includes ICU i18n library and necessary data
116
+ * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
117
+ * give correct results when using with locales other than en-US. Note that
118
+ * this variant is about 6MiB larger per architecture than default.
119
+ */
120
+ def jscFlavor = ' org.webkit:android-jsc:+'
121
+
122
+ /**
123
+ * Whether to enable the Hermes VM.
124
+ *
125
+ * This should be set on project.ext.react and mirrored here. If it is not set
126
+ * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
127
+ * and the benefits of using Hermes will therefore be sharply reduced.
128
+ */
129
+ def enableHermes = project. ext. react. get(" enableHermes" , false );
130
+
107
131
def getVersionCode = { ->
108
132
new ByteArrayOutputStream (). withStream { stdOut ->
109
133
if (project. hasProperty(" versionCode" )) {
@@ -162,6 +186,7 @@ android {
162
186
ndk {
163
187
abiFilters getEnvOrConfig(' NDK_ABI_FILTERS' ). split(' ;' )
164
188
}
189
+ missingDimensionStrategy ' react-native-camera' , ' general'
165
190
}
166
191
/**
167
192
* Arbitrary project metadata
@@ -179,8 +204,15 @@ android {
179
204
packagingOptions {
180
205
exclude ' META-INF/rxjava.properties'
181
206
exclude ' /lib/mips64/**'
182
- exclude ' /lib/arm64-v8a/**'
183
207
exclude ' /lib/armeabi/**'
208
+
209
+ pickFirst ' **/armeabi-v7a/libc++_shared.so'
210
+ pickFirst ' **/x86/libc++_shared.so'
211
+ pickFirst ' **/arm64-v8a/libc++_shared.so'
212
+ pickFirst ' **/x86_64/libc++_shared.so'
213
+ pickFirst ' **/x86/libjsc.so'
214
+ pickFirst ' **/armeabi-v7a/libjsc.so'
215
+
184
216
/* * Fix for: Execution failed for task ':app:transformNativeLibsWithStripDebugSymbolForDebug'.
185
217
* with recent version of ndk (17.0.4754217)
186
218
*/
@@ -192,6 +224,12 @@ android {
192
224
javaMaxHeapSize " 8g"
193
225
}
194
226
signingConfigs {
227
+ debug {
228
+ storeFile file(' debug.keystore' )
229
+ storePassword ' android'
230
+ keyAlias ' androiddebugkey'
231
+ keyPassword ' android'
232
+ }
195
233
release {
196
234
/* environment variables take precedence over gradle.properties file */
197
235
storeFile file(getEnvOrConfig(' STATUS_RELEASE_STORE_FILE' ). replaceAll(" ~" , System . properties[' user.home' ]))
@@ -213,9 +251,13 @@ android {
213
251
applicationIdSuffix " .debug"
214
252
debuggable true
215
253
versionNameSuffix " -SNAPSHOT"
254
+ signingConfig signingConfigs. debug
216
255
resValue " string" , " build_config_package" , " im.status.ethereum"
217
256
}
218
257
release {
258
+ // Caution! In production, you need to generate your own keystore file.
259
+ // see https://facebook.github.io/react-native/docs/signed-apk-android.
260
+ signingConfig signingConfigs. debug
219
261
minifyEnabled enableProguardInReleaseBuilds
220
262
proguardFiles getDefaultProguardFile(" proguard-android.txt" ), " proguard-rules.pro"
221
263
signingConfig signingConfigs. release
@@ -242,6 +284,7 @@ android {
242
284
output. versionCodeOverride =
243
285
versionCodes. get(abi) * 1048576 + defaultConfig. versionCode
244
286
}
287
+
245
288
}
246
289
}
247
290
@@ -256,44 +299,33 @@ android {
256
299
}
257
300
258
301
dependencies {
259
- implementation project(' :@react-native-community_netinfo' )
260
- implementation project(' :react-native-background-timer' )
261
- implementation project(' :react-native-svg' )
302
+ implementation fileTree(dir : " libs" , include : [" *.jar" ])
303
+ implementation " com.facebook.react:react-native:+" // From node_modules
304
+
305
+ if (enableHermes) {
306
+ def hermesPath = " ../../node_modules/hermesvm/android/" ;
307
+ debugImplementation files(hermesPath + " hermes-debug.aar" )
308
+ releaseImplementation files(hermesPath + " hermes-release.aar" )
309
+ prImplementation files(hermesPath + " hermes-release.aar" )
310
+ } else {
311
+ implementation jscFlavor
312
+ }
313
+
262
314
implementation ' com.android.support:multidex:1.0.2'
263
- implementation project(' :react-native-splash-screen' )
264
- implementation project(' :react-native-image-resizer' )
265
315
implementation project(' :react-native-dialogs' )
266
- implementation fileTree(dir : " libs" , include : [" *.jar" ])
267
316
implementation " com.android.support:appcompat-v7:${ rootProject.ext.supportLibVersion} "
268
317
// Force using exact RN version instead of relying on gradle dependency resolution
269
318
// https://docs.gradle.org/current/userguide/introduction_dependency_management.html#sec:dependency_resolution
319
+ // NOTE: Uncomment if building RN from a fork
270
320
// compile ("com.facebook.react:react-native:0.55.4") { force = true } // From node_modules
271
- implementation project(' :react-native-android' )
272
- implementation project(' :react-native-languages' )
273
321
implementation project(' :react-native-status' )
274
- implementation project(' :react-native-fs' )
275
- implementation project(' :react-native-image-crop-picker' )
276
322
implementation project(' :react-native-webview-bridge' )
277
- implementation project(' :react-native-touch-id' )
278
- implementation project(' :react-native-config' )
279
- implementation project(' :react-native-firebase' )
280
- implementation project(' :react-native-shake' )
281
- implementation project(' :react-native-gesture-handler' )
282
- implementation project(' :react-native-screens' )
283
- implementation project(' :RNMail' )
284
- compile (' com.google.android.gms:play-services-base:16.0.1' ) {
285
- force = true
286
- }
287
- compile (project(' :react-native-camera' )) {
288
- exclude group : " com.google.android.gms"
289
- compile ' com.android.support:exifinterface:28.+'
290
- }
291
323
implementation project(' :react-native-status-keycard' )
292
- implementation ' com.google.firebase:firebase-core:16.0.3 ' // this decides your firebase SDK version
293
- implementation ' com.google.firebase:firebase-messaging:17.1.0 '
294
- implementation project( ' :react-native-keychain ' )
324
+ implementation " com.google.android.gms:play-services-base: ${ rootProject.ext.googlePlayServicesVersion } "
325
+ implementation ' com.google.firebase:firebase-core:16.0.9 ' // this decides your firebase SDK version
326
+ implementation ' com.google.firebase:firebase-messaging:18.0.0 '
295
327
296
- compile ' com.github.status-im:function:0.0.1'
328
+ implementation ' com.github.status-im:function:0.0.1'
297
329
implementation ' com.facebook.fresco:animated-gif:1.10.0'
298
330
}
299
331
@@ -318,5 +350,7 @@ task hemroidBuild(type: Exec) {
318
350
preBuild. dependsOn hemroidBuild
319
351
320
352
// Must be at bottom to avoid dependency collision
321
- apply plugin : " com.google.gms.google-services"
353
+ apply plugin : ' com.google.gms.google-services'
322
354
com.google.gms.googleservices.GoogleServicesPlugin . config. disableVersionCheck = true
355
+
356
+ apply from : file(" ../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle" ); applyNativeModulesAppBuildGradle(project)
0 commit comments