11apply plugin : " com.android.application"
2+ apply plugin : " org.jetbrains.kotlin.android"
23apply plugin : " com.facebook.react"
34apply from : project(' :react-native-config' ). projectDir. getPath() + " /dotenv.gradle"
45
5- import com.android.build.OutputFile
6-
76/**
87 * This is the configuration block to customize your React Native Android app.
98 * By default you don't need to apply any configuration, just uncomment the lines you need.
109 */
1110react {
1211 /* 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")
2120
2221 /* Variants */
2322 // The list of variants to that are debuggable. For those we're going to
@@ -51,6 +50,9 @@ react {
5150 //
5251 // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5352 // hermesFlags = ["-O", "-output-source-map"]
53+
54+ /* Autolinking */
55+ autolinkLibrariesWithApp()
5456}
5557
5658project. ext. vectoricons = [
@@ -59,14 +61,6 @@ project.ext.vectoricons = [
5961
6062apply from : " ../../node_modules/react-native-vector-icons/fonts.gradle"
6163
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-
7064/**
7165 * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
7266 */
@@ -85,20 +79,10 @@ def enableProguardInReleaseBuilds = false
8579 */
8680def jscFlavor = ' org.webkit:android-jsc:+'
8781
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-
9882android {
9983 ndkVersion rootProject. ext. ndkVersion
100-
101- compileSdkVersion rootProject. ext. compileSdkVersion
84+ buildToolsVersion rootProject . ext . buildToolsVersion
85+ compileSdk rootProject. ext. compileSdkVersion
10286
10387 namespace " com.instabug.react.example"
10488 defaultConfig {
@@ -111,15 +95,6 @@ android {
11195 testBuildType System . getProperty(' testBuildType' , ' debug' ) // This will later be used to control the test apk build type
11296 testInstrumentationRunner ' androidx.test.runner.AndroidJUnitRunner'
11397 }
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- }
12398 signingConfigs {
12499 debug {
125100 storeFile file(' debug.keystore' )
@@ -141,22 +116,6 @@ android {
141116 proguardFile " ${ rootProject.projectDir} /../node_modules/detox/android/detox/proguard-rules-app.pro"
142117 }
143118 }
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- }
160119 externalNativeBuild {
161120 cmake {
162121 path file(' src/main/cpp/CMakeLists.txt' )
@@ -181,5 +140,3 @@ dependencies {
181140 androidTestImplementation(' com.wix:detox:+' ) { transitive = true }
182141 androidTestImplementation ' junit:junit:4.12'
183142}
184-
185- apply from : file(" ../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle" ); applyNativeModulesAppBuildGradle(project)
0 commit comments