build.gradle 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. // NOTE: Do not place your application dependencies here; they belong
  28. // in the individual module build.gradle files
  29. }
  30. }
  31. 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())
  32. allprojects {
  33. configurations.all {
  34. resolutionStrategy {
  35. force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
  36. }
  37. }
  38. repositories {
  39. maven {
  40. // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
  41. url("$rootDir/../node_modules/react-native/android")
  42. }
  43. maven {
  44. // Android JSC is installed from npm
  45. url("$rootDir/../node_modules/jsc-android/dist")
  46. }
  47. mavenCentral {
  48. // We don't want to fetch react-native from Maven Central as there are
  49. // older versions over there.
  50. content {
  51. excludeGroup "com.facebook.react"
  52. }
  53. }
  54. maven {
  55. // expo-camera bundles a custom com.google.android:cameraview
  56. url "$rootDir/../node_modules/expo-camera/android/maven"
  57. }
  58. maven { url 'https://maven.aliyun.com/repository/public' }
  59. maven { url 'https://maven.aliyun.com/repository/google' }
  60. maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
  61. google()
  62. maven { url 'https://www.jitpack.io' }
  63. }
  64. }