build.gradle 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. apply plugin: "com.android.application"
  2. apply plugin: "org.jetbrains.kotlin.android"
  3. apply plugin: "com.facebook.react"
  4. /**
  5. * This is the configuration block to customize your React Native Android app.
  6. * By default you don't need to apply any configuration, just uncomment the lines you need.
  7. */
  8. react {
  9. /* Folders */
  10. // The root of your project, i.e. where "package.json" lives. Default is '../..'
  11. // root = file("../../")
  12. // The folder where the react-native NPM package is. Default is ../../node_modules/react-native
  13. // reactNativeDir = file("../../node_modules/react-native")
  14. // The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
  15. // codegenDir = file("../../node_modules/@react-native/codegen")
  16. // The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
  17. // cliFile = file("../../node_modules/react-native/cli.js")
  18. /* Variants */
  19. // The list of variants to that are debuggable. For those we're going to
  20. // skip the bundling of the JS bundle and the assets. By default is just 'debug'.
  21. // If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
  22. // debuggableVariants = ["liteDebug", "prodDebug"]
  23. /* Bundling */
  24. // A list containing the node command and its flags. Default is just 'node'.
  25. // nodeExecutableAndArgs = ["node"]
  26. //
  27. // The command to run when bundling. By default is 'bundle'
  28. // bundleCommand = "ram-bundle"
  29. //
  30. // The path to the CLI configuration file. Default is empty.
  31. // bundleConfig = file(../rn-cli.config.js)
  32. //
  33. // The name of the generated asset file containing your JS bundle
  34. // bundleAssetName = "MyApplication.android.bundle"
  35. //
  36. // The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
  37. // entryFile = file("../js/MyApplication.android.js")
  38. //
  39. // A list of extra flags to pass to the 'bundle' commands.
  40. // See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
  41. // extraPackagerArgs = []
  42. /* Hermes Commands */
  43. // The hermes compiler command to run. By default it is 'hermesc'
  44. // hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
  45. //
  46. // The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
  47. // hermesFlags = ["-O", "-output-source-map"]
  48. /* Autolinking */
  49. autolinkLibrariesWithApp()
  50. }
  51. /**
  52. * Set this to true to Run Proguard on Release builds to minify the Java bytecode.
  53. */
  54. def enableProguardInReleaseBuilds = false
  55. /**
  56. * The preferred build flavor of JavaScriptCore (JSC)
  57. *
  58. * For example, to use the international variant, you can use:
  59. * `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
  60. *
  61. * The international variant includes ICU i18n library and necessary data
  62. * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
  63. * give correct results when using with locales other than en-US. Note that
  64. * this variant is about 6MiB larger per architecture than default.
  65. */
  66. def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
  67. android {
  68. ndkVersion rootProject.ext.ndkVersion
  69. buildToolsVersion rootProject.ext.buildToolsVersion
  70. compileSdk rootProject.ext.compileSdkVersion
  71. namespace "com.reactnativemultip80"
  72. defaultConfig {
  73. applicationId "com.reactnativemultip80"
  74. minSdkVersion rootProject.ext.minSdkVersion
  75. targetSdkVersion rootProject.ext.targetSdkVersion
  76. versionCode 1
  77. versionName "1.0"
  78. }
  79. signingConfigs {
  80. debug {
  81. storeFile file('debug.keystore')
  82. storePassword 'android'
  83. keyAlias 'androiddebugkey'
  84. keyPassword 'android'
  85. }
  86. }
  87. buildTypes {
  88. debug {
  89. signingConfig signingConfigs.debug
  90. }
  91. release {
  92. // Caution! In production, you need to generate your own keystore file.
  93. // see https://reactnative.dev/docs/signed-apk-android.
  94. signingConfig signingConfigs.debug
  95. minifyEnabled enableProguardInReleaseBuilds
  96. proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
  97. }
  98. }
  99. }
  100. dependencies {
  101. // The version of react-native is set by the React Native Gradle Plugin
  102. implementation("com.facebook.react:react-android")
  103. if (hermesEnabled.toBoolean()) {
  104. implementation("com.facebook.react:hermes-android")
  105. } else {
  106. implementation jscFlavor
  107. }
  108. }