1
1
apply plugin : " com.android.application"
2
2
apply plugin : " com.facebook.react"
3
3
4
- import com.android.build.OutputFile
5
-
6
4
/**
7
5
* This is the configuration block to customize your React Native Android app.
8
6
* By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -11,10 +9,8 @@ react {
11
9
/* Folders */
12
10
// The root of your project, i.e. where "package.json" lives. Default is '..'
13
11
// 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")
12
+ // The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
13
+ // codegenDir = file("../node_modules/@react-native/codegen")
18
14
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
19
15
// cliFile = file("../node_modules/react-native/cli.js")
20
16
@@ -52,14 +48,6 @@ react {
52
48
// hermesFlags = ["-O", "-output-source-map"]
53
49
}
54
50
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
62
-
63
51
/**
64
52
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
65
53
*/
@@ -78,16 +66,6 @@ def enableProguardInReleaseBuilds = false
78
66
*/
79
67
def jscFlavor = ' org.webkit:android-jsc:+'
80
68
81
- /**
82
- * Private function to get the list of Native Architectures you want to build.
83
- * This reads the value from reactNativeArchitectures in your gradle.properties
84
- * file and works together with the --active-arch-only flag of react-native run-android.
85
- */
86
- def reactNativeArchitectures () {
87
- def value = project. getProperties(). get(" reactNativeArchitectures" )
88
- return value ? value. split(" ," ) : [" armeabi-v7a" , " x86" , " x86_64" , " arm64-v8a" ]
89
- }
90
-
91
69
android {
92
70
ndkVersion rootProject. ext. ndkVersion
93
71
@@ -101,15 +79,6 @@ android {
101
79
versionCode 1
102
80
versionName " 1.0"
103
81
}
104
-
105
- splits {
106
- abi {
107
- reset()
108
- enable enableSeparateBuildPerCPUArchitecture
109
- universalApk false // If true, also generate a universal APK
110
- include (* reactNativeArchitectures())
111
- }
112
- }
113
82
signingConfigs {
114
83
debug {
115
84
storeFile file(' debug.keystore' )
@@ -130,30 +99,11 @@ android {
130
99
proguardFiles getDefaultProguardFile(" proguard-android.txt" ), " proguard-rules.pro"
131
100
}
132
101
}
133
-
134
- // applicationVariants are e.g. debug, release
135
- applicationVariants. all { variant ->
136
- variant. outputs. each { output ->
137
- // For each separate APK per architecture, set a unique version code as described here:
138
- // https://developer.android.com/studio/build/configure-apk-splits.html
139
- // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
140
- def versionCodes = [" armeabi-v7a" : 1 , " x86" : 2 , " arm64-v8a" : 3 , " x86_64" : 4 ]
141
- def abi = output. getFilter(OutputFile . ABI )
142
- if (abi != null ) { // null for the universal-debug, universal-release variants
143
- output. versionCodeOverride =
144
- defaultConfig. versionCode * 1000 + versionCodes. get(abi)
145
- }
146
-
147
- }
148
- }
149
102
}
150
103
151
104
dependencies {
152
105
// The version of react-native is set by the React Native Gradle Plugin
153
106
implementation(" com.facebook.react:react-android" )
154
-
155
- implementation(" androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" )
156
-
157
107
debugImplementation(" com.facebook.flipper:flipper:${ FLIPPER_VERSION} " )
158
108
debugImplementation(" com.facebook.flipper:flipper-network-plugin:${ FLIPPER_VERSION} " ) {
159
109
exclude group :' com.squareup.okhttp3' , module :' okhttp'
0 commit comments