1
1
apply plugin : " com.android.application"
2
+ apply plugin : " org.jetbrains.kotlin.android"
2
3
apply plugin : " com.facebook.react"
3
4
4
- import com.android.build.OutputFile
5
-
6
5
/**
7
6
* This is the configuration block to customize your React Native Android app.
8
7
* By default you don't need to apply any configuration, just uncomment the lines you need.
9
8
*/
10
9
react {
11
10
/* Folders */
12
- // The root of your project, i.e. where "package.json" lives. Default is '..'
13
- // root = file("../")
14
- // The folder where the react-native NPM package is. Default is ../node_modules/react-native
15
- // reactNativeDir = file("../node-modules /react-native")
16
- // The folder where the react-native Codegen package is. Default is ../node_modules/react-native- codegen
17
- // codegenDir = file("../node-modules/ react-native- codegen")
18
- // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
19
- // cliFile = file("../node_modules/react-native/cli.js")
11
+ // The root of your project, i.e. where "package.json" lives. Default is '../.. '
12
+ // root = file("../../ ")
13
+ // The folder where the react-native NPM package is. Default is ../../ node_modules/react-native
14
+ // reactNativeDir = file("../../node_modules /react-native")
15
+ // The folder where the react-native Codegen package is. Default is ../../ node_modules/@ react-native/ codegen
16
+ // codegenDir = file("../../node_modules/@ react-native/ codegen")
17
+ // The cli.js file which is the React Native CLI entrypoint. Default is ../../ node_modules/react-native/cli.js
18
+ // cliFile = file("../../ node_modules/react-native/cli.js")
20
19
21
20
/* Variants */
22
21
// The list of variants to that are debuggable. For those we're going to
@@ -50,15 +49,10 @@ react {
50
49
//
51
50
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
52
51
// hermesFlags = ["-O", "-output-source-map"]
53
- }
54
52
55
- /**
56
- * Set this to true to create four separate APKs instead of one,
57
- * one for each native architecture. This is useful if you don't
58
- * use App Bundles (https://developer.android.com/guide/app-bundle/)
59
- * and want to have separate APKs to upload to the Play Store.
60
- */
61
- def enableSeparateBuildPerCPUArchitecture = false
53
+ /* Autolinking */
54
+ autolinkLibrariesWithApp()
55
+ }
62
56
63
57
/**
64
58
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
@@ -69,14 +63,14 @@ def enableProguardInReleaseBuilds = false
69
63
* The preferred build flavor of JavaScriptCore (JSC)
70
64
*
71
65
* For example, to use the international variant, you can use:
72
- * `def jscFlavor = 'org.webkit:android- jsc-intl:+' `
66
+ * `def jscFlavor = io.github.react-native-community: jsc-android- intl:2026004.+ `
73
67
*
74
68
* The international variant includes ICU i18n library and necessary data
75
69
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
76
70
* give correct results when using with locales other than en-US. Note that
77
71
* this variant is about 6MiB larger per architecture than default.
78
72
*/
79
- def jscFlavor = ' org.webkit:android- jsc: +'
73
+ def jscFlavor = ' io.github.react-native-community: jsc-android:2026004. +'
80
74
81
75
/**
82
76
* Private function to get the list of Native Architectures you want to build.
@@ -91,7 +85,8 @@ def reactNativeArchitectures() {
91
85
android {
92
86
ndkVersion rootProject. ext. ndkVersion
93
87
94
- compileSdkVersion rootProject. ext. compileSdkVersion
88
+ buildToolsVersion rootProject. ext. buildToolsVersion
89
+ compileSdk rootProject. ext. compileSdkVersion
95
90
96
91
namespace " com.leopardtestapp"
97
92
defaultConfig {
@@ -105,14 +100,6 @@ android {
105
100
testInstrumentationRunner ' androidx.test.runner.AndroidJUnitRunner'
106
101
}
107
102
108
- splits {
109
- abi {
110
- reset()
111
- enable enableSeparateBuildPerCPUArchitecture
112
- universalApk false // If true, also generate a universal APK
113
- include (* reactNativeArchitectures())
114
- }
115
- }
116
103
signingConfigs {
117
104
debug {
118
105
storeFile file(' debug.keystore' )
@@ -134,36 +121,12 @@ android {
134
121
proguardFile " ${ rootProject.projectDir} /../node_modules/detox/android/detox/proguard-rules-app.pro"
135
122
}
136
123
}
137
-
138
- // applicationVariants are e.g. debug, release
139
- applicationVariants. all { variant ->
140
- variant. outputs. each { output ->
141
- // For each separate APK per architecture, set a unique version code as described here:
142
- // https://developer.android.com/studio/build/configure-apk-splits.html
143
- // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
144
- def versionCodes = [" armeabi-v7a" : 1 , " x86" : 2 , " arm64-v8a" : 3 , " x86_64" : 4 ]
145
- def abi = output. getFilter(OutputFile . ABI )
146
- if (abi != null ) { // null for the universal-debug, universal-release variants
147
- output. versionCodeOverride =
148
- defaultConfig. versionCode * 1000 + versionCodes. get(abi)
149
- }
150
-
151
- }
152
- }
153
124
}
154
125
155
126
dependencies {
156
127
// The version of react-native is set by the React Native Gradle Plugin
157
128
implementation(" com.facebook.react:react-android" )
158
129
159
- implementation(" androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" )
160
-
161
- debugImplementation(" com.facebook.flipper:flipper:${ FLIPPER_VERSION} " )
162
- debugImplementation(" com.facebook.flipper:flipper-network-plugin:${ FLIPPER_VERSION} " ) {
163
- exclude group :' com.squareup.okhttp3' , module :' okhttp'
164
- }
165
-
166
- debugImplementation(" com.facebook.flipper:flipper-fresco-plugin:${ FLIPPER_VERSION} " )
167
130
if (hermesEnabled. toBoolean()) {
168
131
implementation(" com.facebook.react:hermes-android" )
169
132
} else {
@@ -173,5 +136,3 @@ dependencies {
173
136
androidTestImplementation(' com.wix:detox:+' )
174
137
implementation ' androidx.appcompat:appcompat:1.1.0'
175
138
}
176
-
177
- apply from : file(" ../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle" ); applyNativeModulesAppBuildGradle(project)
0 commit comments