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.
@@ -13,8 +12,9 @@ react {
13
12
// root = file("../")
14
13
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
15
14
// 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")
15
+
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
18
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
19
19
// cliFile = file("../node_modules/react-native/cli.js")
20
20
@@ -52,14 +52,6 @@ react {
52
52
// hermesFlags = ["-O", "-output-source-map"]
53
53
}
54
54
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
55
/**
64
56
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
65
57
*/
@@ -78,20 +70,11 @@ def enableProguardInReleaseBuilds = false
78
70
*/
79
71
def jscFlavor = ' org.webkit:android-jsc:+'
80
72
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
73
android {
92
74
ndkVersion rootProject. ext. ndkVersion
93
75
94
- compileSdkVersion rootProject. ext. compileSdkVersion
76
+ buildToolsVersion rootProject. ext. buildToolsVersion
77
+ compileSdk rootProject. ext. compileSdkVersion
95
78
96
79
namespace " com.urbanairship.sample"
97
80
defaultConfig {
@@ -102,51 +85,20 @@ android {
102
85
versionName " 1.0"
103
86
}
104
87
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
88
buildTypes {
114
89
debug {}
115
90
release {
116
91
minifyEnabled enableProguardInReleaseBuilds
117
92
proguardFiles getDefaultProguardFile(" proguard-android.txt" ), " proguard-rules.pro"
118
93
}
119
94
}
120
-
121
- // applicationVariants are e.g. debug, release
122
- applicationVariants. all { variant ->
123
- variant. outputs. each { output ->
124
- // For each separate APK per architecture, set a unique version code as described here:
125
- // https://developer.android.com/studio/build/configure-apk-splits.html
126
- // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
127
- def versionCodes = [" armeabi-v7a" : 1 , " x86" : 2 , " arm64-v8a" : 3 , " x86_64" : 4 ]
128
- def abi = output. getFilter(OutputFile . ABI )
129
- if (abi != null ) { // null for the universal-debug, universal-release variants
130
- output. versionCodeOverride =
131
- defaultConfig. versionCode * 1000 + versionCodes. get(abi)
132
- }
133
-
134
- }
135
- }
136
95
}
137
96
138
97
dependencies {
139
98
// The version of react-native is set by the React Native Gradle Plugin
140
99
implementation(" com.facebook.react:react-android" )
100
+ implementation(" com.facebook.react:flipper-integration" )
141
101
142
- implementation(" androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" )
143
-
144
- debugImplementation(" com.facebook.flipper:flipper:${ FLIPPER_VERSION} " )
145
- debugImplementation(" com.facebook.flipper:flipper-network-plugin:${ FLIPPER_VERSION} " ) {
146
- exclude group :' com.squareup.okhttp3' , module :' okhttp'
147
- }
148
-
149
- debugImplementation(" com.facebook.flipper:flipper-fresco-plugin:${ FLIPPER_VERSION} " )
150
102
if (hermesEnabled. toBoolean()) {
151
103
implementation(" com.facebook.react:hermes-android" )
152
104
} else {
0 commit comments