2017-03-02 11:30:08 +00:00
|
|
|
buildscript {
|
2017-08-18 20:03:44 +00:00
|
|
|
repositories {
|
2018-03-27 14:32:10 +00:00
|
|
|
google()
|
2018-05-29 15:18:04 +00:00
|
|
|
jcenter()
|
2017-12-06 17:25:17 +00:00
|
|
|
maven {
|
|
|
|
url 'https://maven.fabric.io/public'
|
|
|
|
}
|
2017-08-18 20:03:44 +00:00
|
|
|
}
|
|
|
|
dependencies {
|
2018-05-29 15:18:04 +00:00
|
|
|
classpath 'com.android.tools.build:gradle:3.1.2'
|
2018-07-03 15:23:40 +00:00
|
|
|
classpath 'io.fabric.tools:gradle:1.25.4'
|
2017-08-18 20:03:44 +00:00
|
|
|
}
|
2017-03-02 11:30:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'com.android.library'
|
|
|
|
|
2018-04-21 17:10:37 +00:00
|
|
|
def DEFAULT_COMPILE_SDK_VERSION = 27
|
|
|
|
def DEFAULT_BUILD_TOOLS_VERSION = "27.0.3"
|
|
|
|
def DEFAULT_TARGET_SDK_VERSION = 26
|
2018-08-24 13:28:02 +00:00
|
|
|
def DEFAULT_SUPPORT_LIB_VERSION = "27.1.1"
|
2018-04-21 17:10:37 +00:00
|
|
|
|
2017-03-02 11:30:08 +00:00
|
|
|
android {
|
2018-04-21 17:10:37 +00:00
|
|
|
compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
|
|
|
|
buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
|
2017-06-12 13:43:04 +00:00
|
|
|
defaultConfig {
|
|
|
|
minSdkVersion 16
|
2018-04-21 17:10:37 +00:00
|
|
|
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
|
2017-06-12 13:43:04 +00:00
|
|
|
versionCode 1
|
|
|
|
versionName "1.0"
|
2018-03-27 11:44:35 +00:00
|
|
|
multiDexEnabled true
|
2017-06-12 13:43:04 +00:00
|
|
|
}
|
|
|
|
buildTypes {
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
2017-03-02 11:30:08 +00:00
|
|
|
}
|
2017-06-12 13:43:04 +00:00
|
|
|
}
|
|
|
|
productFlavors {
|
|
|
|
}
|
2018-07-13 13:03:20 +00:00
|
|
|
lintOptions {
|
|
|
|
disable 'GradleCompatible'
|
|
|
|
}
|
2017-03-02 11:30:08 +00:00
|
|
|
}
|
|
|
|
|
2017-08-18 20:03:44 +00:00
|
|
|
rootProject.gradle.buildFinished { buildResult ->
|
|
|
|
if (buildResult.getFailure() != null) {
|
|
|
|
try {
|
|
|
|
String message = buildResult.getFailure().properties.get("reportableCauses").toString()
|
|
|
|
if (message.contains("com.android.dex.DexException: Multiple dex files define Lcom/google/") ||
|
|
|
|
message.contains("java.util.zip.ZipException: duplicate entry: com/google/android/gms/")) {
|
|
|
|
logger.log(LogLevel.ERROR, "")
|
|
|
|
logger.log(LogLevel.ERROR, " -----------------------------------------------------------")
|
|
|
|
logger.log(LogLevel.ERROR, "| REACT NATIVE FIREBASE |")
|
|
|
|
logger.log(LogLevel.ERROR, " ----------------------------------------------------------- ")
|
|
|
|
logger.log(LogLevel.ERROR, "| |")
|
|
|
|
logger.log(LogLevel.ERROR, "| This is a common build error when using libraries that |")
|
|
|
|
logger.log(LogLevel.ERROR, "| require google play services. |")
|
|
|
|
logger.log(LogLevel.ERROR, "| |")
|
|
|
|
logger.log(LogLevel.ERROR, "| This error occurs because different versions of google |")
|
|
|
|
logger.log(LogLevel.ERROR, "| play services or google play services modules are being |")
|
|
|
|
logger.log(LogLevel.ERROR, "| required by different libraries. |")
|
|
|
|
logger.log(LogLevel.ERROR, "| |")
|
|
|
|
logger.log(LogLevel.ERROR, "| A temporary fix would be to set: |")
|
|
|
|
logger.log(LogLevel.ERROR, "| |")
|
|
|
|
logger.log(LogLevel.ERROR, "| android { multiDexEnabled true } |")
|
|
|
|
logger.log(LogLevel.ERROR, "| |")
|
|
|
|
logger.log(LogLevel.ERROR, "| inside your build gradle, however it is recommended for |")
|
|
|
|
logger.log(LogLevel.ERROR, "| your prod build that you de-duplicate these to minimize |")
|
|
|
|
logger.log(LogLevel.ERROR, "| bundle size. |")
|
|
|
|
logger.log(LogLevel.ERROR, "| |")
|
|
|
|
logger.log(LogLevel.ERROR, "| See http://invertase.link/dupe-dex for how to do this. |")
|
|
|
|
logger.log(LogLevel.ERROR, "| |")
|
|
|
|
logger.log(LogLevel.ERROR, " ----------------------------------------------------------- ")
|
|
|
|
}
|
2018-07-13 13:03:20 +00:00
|
|
|
} catch (Exception exception) {
|
|
|
|
}
|
2017-08-18 20:03:44 +00:00
|
|
|
}
|
2017-03-02 11:30:08 +00:00
|
|
|
}
|
2017-08-18 20:03:44 +00:00
|
|
|
|
2018-07-19 23:56:43 +00:00
|
|
|
repositories {
|
|
|
|
google()
|
|
|
|
jcenter()
|
|
|
|
maven {
|
|
|
|
url "$rootDir/../node_modules/react-native/android"
|
|
|
|
name 'React Native (local)'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-04-21 17:10:37 +00:00
|
|
|
def supportVersion = rootProject.hasProperty('supportLibVersion') ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIB_VERSION
|
2017-03-02 11:30:08 +00:00
|
|
|
|
|
|
|
dependencies {
|
2018-03-28 14:51:08 +00:00
|
|
|
// compile fileTree(include: ['*.jar'], dir: 'libs')
|
|
|
|
api "com.facebook.react:react-native:+" // From node_modules
|
2018-04-21 17:10:37 +00:00
|
|
|
api "com.android.support:support-v4:$supportVersion"
|
2018-07-08 13:37:14 +00:00
|
|
|
|
|
|
|
// Firebase SDKs
|
2018-05-29 15:18:04 +00:00
|
|
|
compileOnly('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
|
2017-12-06 17:25:17 +00:00
|
|
|
transitive = true
|
|
|
|
}
|
2018-08-24 13:28:02 +00:00
|
|
|
|
|
|
|
//noinspection GradleCompatible
|
|
|
|
compileOnly "com.google.firebase:firebase-core:16.0.3"
|
2018-05-29 15:18:04 +00:00
|
|
|
compileOnly "com.google.android.gms:play-services-base:15.0.1"
|
|
|
|
compileOnly "com.google.firebase:firebase-ads:15.0.1"
|
2018-08-24 13:28:02 +00:00
|
|
|
compileOnly "com.google.firebase:firebase-auth:16.0.3"
|
2018-05-29 15:18:04 +00:00
|
|
|
compileOnly "com.google.firebase:firebase-config:16.0.0"
|
2018-08-24 13:28:02 +00:00
|
|
|
compileOnly "com.google.firebase:firebase-crash:16.2.0"
|
2018-05-29 15:18:04 +00:00
|
|
|
compileOnly "com.google.firebase:firebase-database:16.0.1"
|
2018-08-24 13:28:02 +00:00
|
|
|
compileOnly "com.google.firebase:firebase-firestore:17.1.0"
|
2018-08-14 01:00:27 +00:00
|
|
|
compileOnly "com.google.firebase:firebase-functions:16.1.0"
|
2018-08-24 13:28:02 +00:00
|
|
|
compileOnly "com.google.firebase:firebase-invites:16.0.3"
|
2018-05-29 15:18:04 +00:00
|
|
|
compileOnly "com.google.firebase:firebase-storage:16.0.1"
|
2018-08-24 13:28:02 +00:00
|
|
|
compileOnly "com.google.firebase:firebase-messaging:17.3.0"
|
|
|
|
compileOnly "com.google.firebase:firebase-perf:16.1.0"
|
2018-05-08 14:36:40 +00:00
|
|
|
compileOnly 'me.leolin:ShortcutBadger:1.1.21@aar'
|
2017-03-02 11:30:08 +00:00
|
|
|
}
|