forked from upstream-mirrors/quik
Update crashlytics
This commit is contained in:
+1
-3
@@ -35,7 +35,6 @@ buildscript {
|
|||||||
ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2]
|
ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2]
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
maven { url 'https://maven.fabric.io/public' }
|
|
||||||
maven { url 'https://maven.google.com' }
|
maven { url 'https://maven.google.com' }
|
||||||
jcenter()
|
jcenter()
|
||||||
google()
|
google()
|
||||||
@@ -43,9 +42,9 @@ buildscript {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:3.6.3'
|
classpath 'com.android.tools.build:gradle:3.6.3'
|
||||||
|
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
|
||||||
classpath 'com.google.gms:google-services:4.2.0'
|
classpath 'com.google.gms:google-services:4.2.0'
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
classpath 'io.fabric.tools:gradle:1.29.0'
|
|
||||||
classpath "io.realm:realm-gradle-plugin:$realm_version"
|
classpath "io.realm:realm-gradle-plugin:$realm_version"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -55,7 +54,6 @@ allprojects {
|
|||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
maven { url "https://jitpack.io" }
|
maven { url "https://jitpack.io" }
|
||||||
maven { url 'https://maven.fabric.io/public' }
|
|
||||||
maven { url 'https://maven.google.com' }
|
maven { url 'https://maven.google.com' }
|
||||||
maven {
|
maven {
|
||||||
name 'glide-snapshot'
|
name 'glide-snapshot'
|
||||||
|
|||||||
@@ -186,8 +186,7 @@ dependencies {
|
|||||||
implementation project(':data')
|
implementation project(':data')
|
||||||
implementation project(':domain')
|
implementation project(':domain')
|
||||||
|
|
||||||
withAnalyticsImplementation 'com.google.firebase:firebase-core:16.0.9'
|
withAnalyticsImplementation 'com.google.firebase:firebase-crashlytics:17.3.0'
|
||||||
withAnalyticsImplementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
|
|
||||||
|
|
||||||
noAnalyticsDebug project(path: ':data', configuration: 'noAnalyticsDebug')
|
noAnalyticsDebug project(path: ':data', configuration: 'noAnalyticsDebug')
|
||||||
noAnalyticsRelease project(path: ':data', configuration: 'noAnalyticsRelease')
|
noAnalyticsRelease project(path: ':data', configuration: 'noAnalyticsRelease')
|
||||||
@@ -196,6 +195,6 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (getGradle().getStartParameter().getTaskRequests().toString().contains("WithAnalytics")) {
|
if (getGradle().getStartParameter().getTaskRequests().toString().contains("WithAnalytics")) {
|
||||||
apply plugin: 'io.fabric'
|
|
||||||
apply plugin: 'com.google.gms.google-services'
|
apply plugin: 'com.google.gms.google-services'
|
||||||
|
apply plugin: 'com.google.firebase.crashlytics'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,15 +18,25 @@
|
|||||||
*/
|
*/
|
||||||
package com.moez.QKSMS.common.util
|
package com.moez.QKSMS.common.util
|
||||||
|
|
||||||
import com.crashlytics.android.Crashlytics
|
import android.util.Log
|
||||||
|
import com.google.firebase.crashlytics.FirebaseCrashlytics
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
class CrashlyticsTree : Timber.Tree() {
|
class CrashlyticsTree : Timber.Tree() {
|
||||||
|
|
||||||
override fun log(priority: Int, tag: String?, message: String?, throwable: Throwable?) {
|
override fun log(priority: Int, tag: String?, message: String?, throwable: Throwable?) {
|
||||||
Crashlytics.log(message)
|
val crashlytics = FirebaseCrashlytics.getInstance()
|
||||||
|
val priorityString = when (priority) {
|
||||||
|
Log.VERBOSE -> "V"
|
||||||
|
Log.DEBUG -> "D"
|
||||||
|
Log.INFO -> "I"
|
||||||
|
Log.WARN -> "W"
|
||||||
|
Log.ERROR -> "E"
|
||||||
|
else -> "WTF"
|
||||||
|
}
|
||||||
|
|
||||||
throwable?.run(Crashlytics::logException)
|
crashlytics.log("$priorityString/$tag: $message")
|
||||||
|
throwable?.run(crashlytics::recordException)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user