Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apply plugin: "com.android.application"
- apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
- import com.android.build.OutputFile
- project.ext.react = [
- enableHermes: false
- ]
- apply from: '../../node_modules/react-native-unimodules/gradle.groovy'
- apply from: "../../node_modules/react-native/react.gradle"
- apply from: "../../node_modules/expo-constants/scripts/get-app-config-android.gradle"
- apply from: "../../node_modules/expo-updates/scripts/create-manifest-android.gradle"
- def enableSeparateBuildPerCPUArchitecture = false
- def enableProguardInReleaseBuilds = false
- def jscFlavor = 'org.webkit:android-jsc:+'
- def enableHermes = project.ext.react.get("enableHermes", false);
- android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- dexOptions {
- javaMaxHeapSize "4g"
- }
- compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
- }
- defaultConfig {
- applicationId "redacted"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- }
- splits {
- abi {
- reset()
- enable enableSeparateBuildPerCPUArchitecture
- universalApk false // If true, also generate a universal APK
- include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
- }
- }
- signingConfigs {
- debug {
- storeFile file('debug.keystore')
- storePassword 'android'
- keyAlias 'androiddebugkey'
- keyPassword 'android'
- }
- release {
- storeFile file('your_key_name.keystore')
- storePassword 'redacted'
- keyAlias 'redacted'
- keyPassword 'redacted'
- }
- }
- buildTypes {
- debug {
- signingConfig signingConfigs.debug
- }
- release {
- // Caution! In production, you need to generate your own keystore file.
- // see https://reactnative.dev/docs/signed-apk-android.
- signingConfig signingConfigs.release
- minifyEnabled enableProguardInReleaseBuilds
- proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
- }
- }
- // applicationVariants are e.g. debug, release
- applicationVariants.all { variant ->
- variant.outputs.each { output ->
- // For each separate APK per architecture, set a unique version code as described here:
- // https://developer.android.com/studio/build/configure-apk-splits.html
- def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
- def abi = output.getFilter(OutputFile.ABI)
- if (abi != null) { // null for the universal-debug, universal-release variants
- output.versionCodeOverride =
- versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
- }
- }
- }
- }
- dependencies {
- implementation fileTree(dir: "libs", include: ["*.jar"])
- //noinspection GradleDynamicVersion
- implementation "com.facebook.react:react-native:+" // From node_modules
- implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
- debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
- exclude group:'com.facebook.fbjni'
- }
- debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
- exclude group:'com.facebook.flipper'
- exclude group:'com.squareup.okhttp3', module:'okhttp'
- }
- debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
- exclude group:'com.facebook.flipper'
- }
- addUnimodulesDependencies()
- if (enableHermes) {
- def hermesPath = "../../node_modules/hermes-engine/android/";
- debugImplementation files(hermesPath + "hermes-debug.aar")
- releaseImplementation files(hermesPath + "hermes-release.aar")
- } else {
- implementation jscFlavor
- }
- }
- // Run this once to be able to run the application with BUCK
- // puts all compile dependencies into folder libs for BUCK to use
- task copyDownloadableDepsToLibs(type: Copy) {
- from configurations.compile
- into 'libs'
- }
- apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement