Facebook
From Cream Pudu, 2 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 159
  1. apply plugin: "com.android.application"
  2.  
  3. import com.android.build.OutputFile
  4.  
  5. project.ext.react = [
  6.     entryFile: "index.android.js",
  7.     enableHermes: true,
  8.     hermesCommand: "../../node_modules/hermes-engine/%OS-BIN%/hermes",
  9. ]
  10.  
  11. def enableSeparateBuildPerCPUArchitecture = true
  12. def enableProguardInReleaseBuilds = true
  13.  
  14. android {
  15.  
  16.     compileSdkVersion 29
  17.     buildToolsVersion "29.0.3"
  18.  
  19.     dexOptions {
  20.         incremental true
  21.         javaMaxHeapSize "4g"
  22.         preDexLibraries true
  23.         dexInProcess = true
  24.     }
  25.  
  26.     def versionMajor = 1
  27.     def versionMinor = 0
  28.     def versionPatch = 903
  29.     def versionBuild = 0
  30.  
  31.     defaultConfig {
  32.         applicationId "xxx"
  33.         minSdkVersion 21
  34.         targetSdkVersion 29
  35.         versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
  36.         versionName "${versionMajor}.${versionMinor}.${versionPatch}"
  37.  
  38.         multiDexEnabled true
  39.     }
  40.  
  41.     compileOptions {
  42.         sourceCompatibility JavaVersion.VERSION_1_8
  43.         targetCompatibility JavaVersion.VERSION_1_8
  44.     }
  45.  
  46.     signingConfigs {
  47.         release {
  48.             if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
  49.                 storeFile file(MYAPP_RELEASE_STORE_FILE)
  50.                 storePassword MYAPP_RELEASE_STORE_PASSWORD
  51.                 keyAlias MYAPP_RELEASE_KEY_ALIAS
  52.                 keyPassword MYAPP_RELEASE_KEY_PASSWORD
  53.             }
  54.         }
  55.     }
  56.  
  57.     splits {
  58.         abi {
  59.             reset()
  60.             enable enableSeparateBuildPerCPUArchitecture
  61.             universalApk false  // If true, also generate a universal APK
  62.             include 'armeabi-v7a','arm64-v8a','x86','x86_64'
  63.         }
  64.     }
  65.    
  66.     buildTypes {
  67.         release {
  68.             shrinkResources enableProguardInReleaseBuilds
  69.             zipAlignEnabled enableProguardInReleaseBuilds
  70.             minifyEnabled enableProguardInReleaseBuilds
  71.             useProguard enableProguardInReleaseBuilds
  72.             setProguardFiles([getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'])
  73.             signingConfig signingConfigs.release
  74.         }
  75.     }
  76.     lintOptions { checkReleaseBuilds false }
  77.  
  78.     project.ext.versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a":3, "x86_64":4]
  79.     applicationVariants.all {
  80.         variant -> variant.outputs.each {
  81.             output ->
  82.                 output.versionCodeOverride =
  83.                     project.ext.versionCodes.get(output.getFilter(com.android.build.OutputFile.ABI), 0) * 1900000 + android.defaultConfig.versionCode
  84.         }
  85.     }
  86.     packagingOptions {
  87.         pickFirst 'lib/x86/libc++_shared.so'
  88.         pickFirst 'lib/arm64-v8a/libc++_shared.so'
  89.         pickFirst 'lib/x86_64/libc++_shared.so'
  90.         pickFirst 'lib/armeabi-v7a/libc++_shared.so'
  91.  
  92.     }
  93. }
  94.  
  95. configurations.all {
  96.     resolutionStrategy {
  97.         force "com.facebook.soloader:soloader:0.10.1+"
  98.     }
  99. }
  100.  
  101. dependencies {
  102.     compile 'com.android.support:multidex:1.0.3'
  103.  
  104.     implementation project(':rn-fetch-blob')
  105.     implementation project(':react-native-cookies')
  106.     implementation project(':@react-native-firebase_app')
  107.     implementation project(':react-native-extra-dimensions-android')
  108.     implementation project(':react-native-exception-handler')
  109.     implementation project(':@react-native-community_netinfo')
  110.     implementation project(':@react-native-community_async-storage')
  111.     implementation fileTree(dir: "libs", include: ["*.jar"])
  112.  
  113.     implementation project(':react-native-fast-image')
  114.  
  115.     implementation project(':react-native-splash-screen')
  116.     implementation project(':react-native-share')
  117.     implementation project(':react-native-linear-gradient')
  118.     implementation project(':react-native-fs')
  119.     implementation project(':react-native-vector-icons')
  120.    
  121.     implementation (project(':react-native-device-info')){
  122.         exclude group: "com.google.android.gms"
  123.     }
  124.     implementation 'com.facebook.fresco:fresco:2.0.0'
  125.     implementation 'com.facebook.fresco:animated-gif:2.0.0'
  126.  
  127.     implementation ('com.google.android.gms:play-services-gcm:17.0.0') {
  128.         force = true;
  129.     }
  130.  
  131.     implementation project(path: ":@react-native-firebase_analytics")
  132.     implementation project(path: ":@react-native-firebase_messaging")
  133.    
  134.     implementation 'com.google.android.gms:play-services-base:17.6.0'
  135.  
  136.     implementation project(':react-native-push-notification')
  137.    
  138.     implementation "androidx.appcompat:appcompat:1.3.0"
  139.     implementation "com.facebook.react:react-native:+"  
  140.  
  141.     implementation 'androidx.arch.core:core-runtime:2.1.0'
  142.     implementation 'androidx.arch.core:core-common:2.1.0'
  143.  
  144.     def hermesPath = "../../node_modules/hermes-engine/android/";
  145.     debugImplementation files(hermesPath + "hermes-debug.aar")
  146.     releaseImplementation files(hermesPath + "hermes-release.aar")
  147.  
  148.     implementation project(':lottie-react-native')
  149.    
  150. }
  151.  
  152. task copyDownloadableDepsToLibs(type: Copy) {
  153.     from configurations.compile
  154.     into 'libs'
  155. }
  156.  
  157. apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle")
  158. applyNativeModulesAppBuildGradle(project)
  159.  
  160.  
  161. apply plugin: 'com.google.gms.google-services'
  162.