xref: /MusicFree/android/build.gradle (revision 2aa881935ca35b8fb1abc4206e0dc35149231456)
1import org.apache.tools.ant.taskdefs.condition.Os
2
3// Top-level build file where you can add configuration options common to all sub-projects/modules.
4
5buildscript {
6    ext {
7        buildToolsVersion = "31.0.0"
8        minSdkVersion = 21
9        compileSdkVersion = 33
10        targetSdkVersion = 30
11
12        if (System.properties['os.arch'] == "aarch64") {
13            // For M1 Users we need to use the NDK 24 which added support for aarch64
14            ndkVersion = "24.0.8215888"
15        } else {
16            // Otherwise we default to the side-by-side NDK version from AGP.
17            ndkVersion = "21.4.7075529"
18        }
19    }
20    repositories {
21        google()
22        mavenCentral()
23    }
24    dependencies {
25        classpath('com.android.tools.build:gradle:7.1.2')
26        classpath("com.facebook.react:react-native-gradle-plugin")
27        classpath("de.undercouch:gradle-download-task:5.0.1")
28        // NOTE: Do not place your application dependencies here; they belong
29        // in the individual module build.gradle files
30    }
31}
32
33allprojects {
34    repositories {
35        // https://github.com/facebook/react-native/issues/35210
36         exclusiveContent {
37           // We get React Native's Android binaries exclusively through npm,
38           // from a local Maven repo inside node_modules/react-native/.
39           // (The use of exclusiveContent prevents looking elsewhere like Maven Central
40           // and potentially getting a wrong version.)
41           filter {
42               includeGroup "com.facebook.react"
43           }
44           forRepository {
45               maven {
46                   url "$rootDir/../node_modules/react-native/android"
47               }
48           }
49       }
50        maven {
51            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
52            url("$rootDir/../node_modules/react-native/android")
53        }
54        maven {
55            // Android JSC is installed from npm
56            url("$rootDir/../node_modules/jsc-android/dist")
57        }
58        mavenCentral {
59            // We don't want to fetch react-native from Maven Central as there are
60            // older versions over there.
61            content {
62                excludeGroup "com.facebook.react"
63            }
64        }
65        google()
66        maven { url 'https://maven.aliyun.com/repository/jcenter' }
67        maven { url 'https://www.jitpack.io' }
68    }
69}
70