build.gradle 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  2. buildscript {
  3. ext {
  4. buildToolsVersion = "31.0.0"
  5. minSdkVersion = 21
  6. compileSdkVersion = 31
  7. targetSdkVersion = 31
  8. if (System.properties['os.arch'] == "aarch64") {
  9. // For M1 Users we need to use the NDK 24 which added support for aarch64
  10. ndkVersion = "24.0.8215888"
  11. } else {
  12. // Otherwise we default to the side-by-side NDK version from AGP.
  13. ndkVersion = "21.4.7075529"
  14. }
  15. }
  16. repositories {
  17. maven { url 'https://maven.aliyun.com/repository/public' }
  18. maven { url 'https://maven.aliyun.com/repository/google' }
  19. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  20. google()
  21. mavenCentral()
  22. }
  23. dependencies {
  24. classpath("com.android.tools.build:gradle:7.2.1")
  25. classpath("com.facebook.react:react-native-gradle-plugin")
  26. classpath("de.undercouch:gradle-download-task:5.0.1")
  27. //gms
  28. // classpath 'com.google.gms:google-services:4.3.8'
  29. // NOTE: Do not place your application dependencies here; they belong
  30. // in the individual module build.gradle files
  31. }
  32. }
  33. def REACT_NATIVE_VERSION = new File(['node', '--print', "JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
  34. allprojects {
  35. configurations.all {
  36. resolutionStrategy {
  37. force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
  38. }
  39. }
  40. repositories {
  41. maven {
  42. // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
  43. url("$rootDir/../node_modules/react-native/android")
  44. }
  45. maven {
  46. // Android JSC is installed from npm
  47. url("$rootDir/../node_modules/jsc-android/dist")
  48. }
  49. mavenCentral {
  50. // We don't want to fetch react-native from Maven Central as there are
  51. // older versions over there.
  52. content {
  53. excludeGroup "com.facebook.react"
  54. }
  55. }
  56. maven {
  57. // expo-camera bundles a custom com.google.android:cameraview
  58. url "$rootDir/../node_modules/expo-camera/android/maven"
  59. }
  60. //gms
  61. // maven { url "https://maven.google.com" }
  62. maven { url 'https://maven.aliyun.com/repository/public' }
  63. maven { url 'https://maven.aliyun.com/repository/google' }
  64. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  65. google()
  66. maven { url 'https://www.jitpack.io' }
  67. }
  68. }