import org.apache.tools.ant.taskdefs.condition.Os // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { def taskRequests = getGradle().getStartParameter().getTaskRequests().toString().toLowerCase() def isPlay = !taskRequests.contains("foss") ext { buildToolsVersion = "31.0.0" minSdkVersion = 23 compileSdkVersion = 31 targetSdkVersion = 31 if (System.properties['os.arch'] == "aarch64") { // For M1 Users we need to use the NDK 24 which added support for aarch64 ndkVersion = "24.0.8215888" } else { // Otherwise we default to the side-by-side NDK version from AGP. ndkVersion = "21.4.7075529" } glideVersion = "4.11.0" kotlin_version = "1.6.10" kotlinVersion = '1.6.10' supportLibVersion = "28.0.0" libre_build = !(isPlay.toBoolean()) } repositories { mavenLocal() google() maven { url 'https://maven.fabric.io/public' } mavenCentral() } dependencies { if (isPlay) { classpath 'com.google.gms:google-services:4.3.8' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.0' classpath 'com.bugsnag:bugsnag-android-gradle-plugin:7.+' } classpath("com.android.tools.build:gradle:7.0.4") classpath("com.facebook.react:react-native-gradle-plugin") classpath("de.undercouch:gradle-download-task:4.1.2") classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } allprojects { repositories { mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url("$rootDir/../node_modules/react-native/android") } maven { // Android JSC is installed from npm url("$rootDir/../node_modules/jsc-android/dist") } maven { url "$rootDir/../node_modules/detox/Detox-android" } maven { // expo-camera bundles a custom com.google.android:cameraview url "$rootDir/../node_modules/expo-camera/android/maven" } mavenCentral { content { excludeGroup "com.facebook.react" } } google() maven { url 'https://maven.google.com' } maven { url 'https://www.jitpack.io' } // https://stackoverflow.com/a/74333788/5447468 // TODO: remove once we update RN exclusiveContent { // We get React Native's Android binaries exclusively through npm, // from a local Maven repo inside node_modules/react-native/. // (The use of exclusiveContent prevents looking elsewhere like Maven Central // and potentially getting a wrong version.) filter { includeGroup "com.facebook.react" } forRepository { maven { // NOTE: if you are in a monorepo, you may have "$rootDir/../../../node_modules/react-native/android" url "$rootDir/../node_modules/react-native/android" } } } } } subprojects { subproject -> afterEvaluate { if (!project.name.equalsIgnoreCase("app") && project.hasProperty("android")) { android { compileSdkVersion 31 buildToolsVersion "31.0.0" defaultConfig { minSdkVersion 23 targetSdkVersion 31 } } } } }