Нема описа

build.gradle 2.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Top-level build file where you can add configuration options common to all sub-projects/modules.
  2. buildscript {
  3. ext {
  4. buildToolsVersion = findProperty('android.buildToolsVersion') ?: '31.0.0'
  5. minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')
  6. compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '31')
  7. targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '31')
  8. if (findProperty('android.kotlinVersion')) {
  9. kotlinVersion = findProperty('android.kotlinVersion')
  10. }
  11. frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'
  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.2.1')
  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. 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())
  33. allprojects {
  34. configurations.all {
  35. resolutionStrategy {
  36. force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
  37. }
  38. }
  39. repositories {
  40. mavenLocal()
  41. maven {
  42. // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
  43. url(new File(['node', '--print', "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), '../android'))
  44. }
  45. maven {
  46. // Android JSC is installed from npm
  47. url(new File(['node', '--print', "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), '../dist'))
  48. }
  49. google()
  50. mavenCentral {
  51. // We don't want to fetch react-native from Maven Central as there are
  52. // older versions over there.
  53. content {
  54. excludeGroup 'com.facebook.react'
  55. }
  56. }
  57. maven { url 'https://www.jitpack.io' }
  58. }
  59. }