2017-04-23 19:22:19 +00:00
|
|
|
apply plugin: "com.android.application"
|
2017-05-24 11:37:26 +00:00
|
|
|
apply plugin: "com.google.firebase.firebase-perf"
|
2017-12-06 17:25:17 +00:00
|
|
|
apply plugin: 'io.fabric'
|
2017-04-23 19:22:19 +00:00
|
|
|
|
|
|
|
import com.android.build.OutputFile
|
|
|
|
|
2017-08-18 20:03:44 +00:00
|
|
|
project.ext.react = [
|
2018-01-16 17:08:44 +00:00
|
|
|
entryFile: "index.js"
|
2017-08-18 20:03:44 +00:00
|
|
|
]
|
2017-06-22 13:09:50 +00:00
|
|
|
|
2017-04-23 19:22:19 +00:00
|
|
|
apply from: "../../node_modules/react-native/react.gradle"
|
|
|
|
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Set this to true to create two separate APKs instead of one:
|
|
|
|
* - An APK that only works on ARM devices
|
|
|
|
* - An APK that only works on x86 devices
|
|
|
|
* The advantage is the size of the APK is reduced by about 4MB.
|
|
|
|
* Upload all the APKs to the Play Store and people will download
|
|
|
|
* the correct one based on the CPU architecture of their device.
|
|
|
|
*/
|
|
|
|
def enableSeparateBuildPerCPUArchitecture = false
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Run Proguard to shrink the Java bytecode in release builds.
|
|
|
|
*/
|
|
|
|
def enableProguardInReleaseBuilds = false
|
|
|
|
|
|
|
|
android {
|
2018-03-23 17:03:53 +00:00
|
|
|
compileSdkVersion 27
|
2018-03-28 14:51:08 +00:00
|
|
|
buildToolsVersion '27.0.3'
|
2017-04-23 19:22:19 +00:00
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId "com.reactnativefirebasedemo"
|
|
|
|
minSdkVersion 16
|
2017-08-18 20:03:44 +00:00
|
|
|
targetSdkVersion 26
|
2017-04-23 19:22:19 +00:00
|
|
|
versionCode 1
|
|
|
|
versionName "1.0"
|
|
|
|
ndk {
|
|
|
|
abiFilters "armeabi-v7a", "x86"
|
|
|
|
}
|
2017-10-03 17:02:33 +00:00
|
|
|
multiDexEnabled true
|
2017-04-23 19:22:19 +00:00
|
|
|
}
|
|
|
|
splits {
|
|
|
|
abi {
|
|
|
|
reset()
|
|
|
|
enable enableSeparateBuildPerCPUArchitecture
|
|
|
|
universalApk false // If true, also generate a universal APK
|
|
|
|
include "armeabi-v7a", "x86"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
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:
|
|
|
|
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
|
2018-01-16 17:08:44 +00:00
|
|
|
def versionCodes = ["armeabi-v7a":1, "x86":2]
|
2017-04-23 19:22:19 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-03-23 17:03:53 +00:00
|
|
|
project.ext.firebaseVersion = '12.0.0'
|
2017-05-30 15:16:56 +00:00
|
|
|
|
2017-04-23 19:22:19 +00:00
|
|
|
dependencies {
|
2018-03-28 14:51:08 +00:00
|
|
|
implementation project(':react-native-vector-icons')
|
|
|
|
implementation(project(':react-native-firebase')) {
|
2018-02-01 09:02:20 +00:00
|
|
|
transitive = false
|
|
|
|
}
|
2018-03-28 14:51:08 +00:00
|
|
|
implementation fileTree(dir: "libs", include: ["*.jar"])
|
|
|
|
implementation "com.google.android.gms:play-services-base:$firebaseVersion"
|
|
|
|
implementation "com.google.firebase:firebase-ads:$firebaseVersion"
|
|
|
|
implementation "com.google.firebase:firebase-auth:$firebaseVersion"
|
|
|
|
implementation "com.google.firebase:firebase-config:$firebaseVersion"
|
|
|
|
implementation "com.google.firebase:firebase-core:$firebaseVersion"
|
|
|
|
implementation "com.google.firebase:firebase-crash:$firebaseVersion"
|
2018-03-28 16:21:52 +00:00
|
|
|
implementation "com.google.firebase:firebase-database:$firebaseVersion"
|
2018-03-28 14:51:08 +00:00
|
|
|
implementation "com.google.firebase:firebase-messaging:$firebaseVersion"
|
|
|
|
implementation "com.google.firebase:firebase-perf:$firebaseVersion"
|
|
|
|
implementation "com.google.firebase:firebase-storage:$firebaseVersion"
|
|
|
|
implementation "com.google.firebase:firebase-firestore:$firebaseVersion"
|
|
|
|
implementation "com.google.firebase:firebase-invites:$firebaseVersion"
|
|
|
|
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
|
2017-12-06 17:25:17 +00:00
|
|
|
transitive = true
|
|
|
|
}
|
2018-03-28 14:51:08 +00:00
|
|
|
implementation "com.android.support:appcompat-v7:27.0.2"
|
|
|
|
implementation "com.facebook.react:react-native:+" // From node_modules
|
2017-04-23 19:22:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 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 plugin: 'com.google.gms.google-services'
|