1
1
apply plugin : " com.android.application"
2
+ apply plugin : " org.jetbrains.kotlin.android"
2
3
apply plugin : " com.facebook.react"
3
4
apply from : project(' :react-native-config' ). projectDir. getPath() + " /dotenv.gradle"
4
5
5
- import com.android.build.OutputFile
6
-
7
6
/**
8
7
* This is the configuration block to customize your React Native Android app.
9
8
* By default you don't need to apply any configuration, just uncomment the lines you need.
10
9
*/
11
10
react {
12
11
/* Folders */
13
- // The root of your project, i.e. where "package.json" lives. Default is '..'
14
- // root = file("../")
15
- // The folder where the react-native NPM package is. Default is ../node_modules/react-native
16
- // reactNativeDir = file("../node_modules/react-native")
17
- // The folder where the react-native Codegen package is. Default is ../node_modules/react-native- codegen
18
- // codegenDir = file("../node_modules/react-native- codegen")
19
- // The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
20
- // cliFile = file("../node_modules/react-native/cli.js")
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")
21
20
22
21
/* Variants */
23
22
// The list of variants to that are debuggable. For those we're going to
@@ -51,6 +50,9 @@ react {
51
50
//
52
51
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
53
52
// hermesFlags = ["-O", "-output-source-map"]
53
+
54
+ /* Autolinking */
55
+ autolinkLibrariesWithApp()
54
56
}
55
57
56
58
project. ext. vectoricons = [
@@ -59,14 +61,6 @@ project.ext.vectoricons = [
59
61
60
62
apply from : " ../../node_modules/react-native-vector-icons/fonts.gradle"
61
63
62
- /**
63
- * Set this to true to create four separate APKs instead of one,
64
- * one for each native architecture. This is useful if you don't
65
- * use App Bundles (https://developer.android.com/guide/app-bundle/)
66
- * and want to have separate APKs to upload to the Play Store.
67
- */
68
- def enableSeparateBuildPerCPUArchitecture = false
69
-
70
64
/**
71
65
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
72
66
*/
@@ -85,20 +79,10 @@ def enableProguardInReleaseBuilds = false
85
79
*/
86
80
def jscFlavor = ' org.webkit:android-jsc:+'
87
81
88
- /**
89
- * Private function to get the list of Native Architectures you want to build.
90
- * This reads the value from reactNativeArchitectures in your gradle.properties
91
- * file and works together with the --active-arch-only flag of react-native run-android.
92
- */
93
- def reactNativeArchitectures () {
94
- def value = project. getProperties(). get(" reactNativeArchitectures" )
95
- return value ? value. split(" ," ) : [" armeabi-v7a" , " x86" , " x86_64" , " arm64-v8a" ]
96
- }
97
-
98
82
android {
99
83
ndkVersion rootProject. ext. ndkVersion
100
-
101
- compileSdkVersion rootProject. ext. compileSdkVersion
84
+ buildToolsVersion rootProject . ext . buildToolsVersion
85
+ compileSdk rootProject. ext. compileSdkVersion
102
86
103
87
namespace " com.instabug.react.example"
104
88
defaultConfig {
@@ -111,15 +95,6 @@ android {
111
95
testBuildType System . getProperty(' testBuildType' , ' debug' ) // This will later be used to control the test apk build type
112
96
testInstrumentationRunner ' androidx.test.runner.AndroidJUnitRunner'
113
97
}
114
-
115
- splits {
116
- abi {
117
- reset()
118
- enable enableSeparateBuildPerCPUArchitecture
119
- universalApk false // If true, also generate a universal APK
120
- include (* reactNativeArchitectures())
121
- }
122
- }
123
98
signingConfigs {
124
99
debug {
125
100
storeFile file(' debug.keystore' )
@@ -141,22 +116,6 @@ android {
141
116
proguardFile " ${ rootProject.projectDir} /../node_modules/detox/android/detox/proguard-rules-app.pro"
142
117
}
143
118
}
144
-
145
- // applicationVariants are e.g. debug, release
146
- applicationVariants. all { variant ->
147
- variant. outputs. each { output ->
148
- // For each separate APK per architecture, set a unique version code as described here:
149
- // https://developer.android.com/studio/build/configure-apk-splits.html
150
- // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
151
- def versionCodes = [" armeabi-v7a" : 1 , " x86" : 2 , " arm64-v8a" : 3 , " x86_64" : 4 ]
152
- def abi = output. getFilter(OutputFile . ABI )
153
- if (abi != null ) { // null for the universal-debug, universal-release variants
154
- output. versionCodeOverride =
155
- defaultConfig. versionCode * 1000 + versionCodes. get(abi)
156
- }
157
-
158
- }
159
- }
160
119
externalNativeBuild {
161
120
cmake {
162
121
path file(' src/main/cpp/CMakeLists.txt' )
@@ -181,5 +140,3 @@ dependencies {
181
140
androidTestImplementation(' com.wix:detox:+' ) { transitive = true }
182
141
androidTestImplementation ' junit:junit:4.12'
183
142
}
184
-
185
- apply from : file(" ../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle" ); applyNativeModulesAppBuildGradle(project)
0 commit comments