Set up Crashlytics

This commit is contained in:
Niels Andriesse 2019-09-06 14:00:36 +10:00
parent 1b585efc90
commit 83742a0fc2
3 changed files with 21 additions and 7 deletions

View File

@ -99,11 +99,16 @@
android:largeHeap="true"> android:largeHeap="true">
<meta-data <meta-data
android:name="com.google.android.geo.API_KEY" android:name="io.fabric.ApiKey"
android:value="AIzaSyCSx9xea86GwDKGznCAULE9Y5a8b-TfN9U"/> android:value="d0c4d13f424a96b9064aa0a9ecafabdb0db4287f" />
<meta-data android:name="com.google.android.gms.version" <meta-data
android:value="@integer/google_play_services_version" /> android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyCSx9xea86GwDKGznCAULE9Y5a8b-TfN9U"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<!-- <meta-data android:name="com.google.android.gms.car.application" <!-- <meta-data android:name="com.google.android.gms.car.application"
android:resource="@xml/automotive_app_desc" /> --> android:resource="@xml/automotive_app_desc" /> -->

View File

@ -7,15 +7,18 @@ buildscript {
ext.identicon_version = "v11" ext.identicon_version = "v11"
ext.rss_parser_version = "2.0.4" ext.rss_parser_version = "2.0.4"
ext.mixpanel_version = "5.+" ext.mixpanel_version = "5.+"
ext.crashlytics_version = "2.10.1"
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
maven { url 'https://maven.fabric.io/public' }
} }
dependencies { dependencies {
classpath "com.android.tools.build:gradle:$gradle_version" classpath "com.android.tools.build:gradle:$gradle_version"
classpath files('libs/gradle-witness.jar') classpath files('libs/gradle-witness.jar')
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "io.fabric.tools:gradle:1.+"
} }
} }
@ -23,6 +26,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
apply plugin: 'witness' apply plugin: 'witness'
apply plugin: 'io.fabric'
repositories { repositories {
mavenLocal() mavenLocal()
@ -58,9 +62,8 @@ repositories {
} }
google() google()
jcenter() jcenter()
maven { maven { url 'https://maven.fabric.io/public' }
url "https://jitpack.io" maven { url "https://jitpack.io" }
}
} }
configurations.all { configurations.all {
@ -186,6 +189,9 @@ dependencies {
implementation "com.github.lelloman:android-identicons:$identicon_version" implementation "com.github.lelloman:android-identicons:$identicon_version"
implementation "com.prof.rssparser:rssparser:$rss_parser_version" implementation "com.prof.rssparser:rssparser:$rss_parser_version"
implementation "com.mixpanel.android:mixpanel-android:$mixpanel_version" implementation "com.mixpanel.android:mixpanel-android:$mixpanel_version"
implementation("com.crashlytics.sdk.android:crashlytics:$crashlytics_version@aar") {
transitive = true
}
} }
def canonicalVersionCode = 12 def canonicalVersionCode = 12

View File

@ -26,6 +26,7 @@ import android.os.Build;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.support.multidex.MultiDexApplication; import android.support.multidex.MultiDexApplication;
import com.crashlytics.android.Crashlytics;
import com.google.android.gms.security.ProviderInstaller; import com.google.android.gms.security.ProviderInstaller;
import com.mixpanel.android.mpmetrics.MixpanelAPI; import com.mixpanel.android.mpmetrics.MixpanelAPI;
@ -96,6 +97,7 @@ import java.util.Set;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import dagger.ObjectGraph; import dagger.ObjectGraph;
import io.fabric.sdk.android.Fabric;
import kotlin.Unit; import kotlin.Unit;
import kotlin.jvm.functions.Function1; import kotlin.jvm.functions.Function1;
import network.loki.messenger.BuildConfig; import network.loki.messenger.BuildConfig;
@ -160,6 +162,7 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
// Loki - Set up P2P API if needed // Loki - Set up P2P API if needed
setUpP2PAPI(); setUpP2PAPI();
// Loki - Set up beta analytics // Loki - Set up beta analytics
Fabric.with(this, new Crashlytics());
mixpanel = MixpanelAPI.getInstance(this, "59040b6707e5a1725f3fb6730fefca92"); mixpanel = MixpanelAPI.getInstance(this, "59040b6707e5a1725f3fb6730fefca92");
Analytics.Companion.getShared().trackImplementation = (Function1<String, Unit>) event -> { Analytics.Companion.getShared().trackImplementation = (Function1<String, Unit>) event -> {
HashMap<String, Object> properties = new HashMap(); HashMap<String, Object> properties = new HashMap();