Skip to content
This repository was archived by the owner on Dec 16, 2023. It is now read-only.

Commit efc1d6b

Browse files
committed
Add Crashlytics
1 parent 1514ffe commit efc1d6b

5 files changed

Lines changed: 32 additions & 1 deletion

File tree

app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
33
apply plugin: 'kotlin-kapt'
44
apply plugin: 'kotlin-android-extensions'
5+
apply plugin: 'io.fabric'
56

67
android {
78
compileSdkVersion 27
@@ -64,6 +65,7 @@ dependencies {
6465
// Other libraries
6566
implementation 'com.squareup.picasso:picasso:2.5.2'
6667
implementation 'com.jakewharton.timber:timber:4.7.1'
68+
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
6769

6870
// Test libraries
6971
testImplementation 'junit:junit:4.12'

app/proguard-rules.pro

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,11 @@
5050
-dontwarn javax.annotation.**
5151
-dontwarn org.conscrypt.**
5252
# A resource is loaded with a relative path so the package of this class must be preserved.
53-
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
53+
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
54+
55+
############################
56+
# Crashlytics
57+
############################
58+
-keepattributes *Annotation*
59+
-keepattributes SourceFile,LineNumberTable
60+
-keep public class * extends java.lang.Exception

app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@
7777
android:name="preloaded_fonts"
7878
android:resource="@array/preloaded_fonts" />
7979

80+
<meta-data
81+
android:name="firebase_crashlytics_collection_enabled"
82+
android:value="false" />
83+
8084
</application>
8185

8286
</manifest>

app/src/main/java/com/marknkamau/justjava/JustJavaApp.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ import com.marknkamau.justjava.data.network.NetworkProvider
1515
import com.marknkamau.justjava.utils.NotificationHelper
1616
import com.marknkamau.justjava.utils.mpesa.Mpesa
1717
import timber.log.Timber
18+
import io.fabric.sdk.android.Fabric
19+
import com.crashlytics.android.Crashlytics
20+
21+
1822

1923
class JustJavaApp : Application() {
2024
lateinit var preferencesRepo: PreferencesRepository
@@ -34,6 +38,11 @@ class JustJavaApp : Application() {
3438
return "Timber ${super.createStackElementTag(element)}.${element.methodName}"
3539
}
3640
})
41+
}else{
42+
val fabric = Fabric.Builder(this)
43+
.kits(Crashlytics())
44+
.build()
45+
Fabric.with(fabric)
3746
}
3847

3948
preferencesRepo = PreferencesRepositoryImpl(PreferenceManager.getDefaultSharedPreferences(this))

build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ buildscript {
1111
maven {
1212
url 'https://oss.sonatype.org/content/repositories/snapshots/'
1313
}
14+
maven {
15+
url 'https://maven.fabric.io/public'
16+
}
17+
1418
}
1519
dependencies {
1620
classpath 'com.android.tools.build:gradle:3.1.4'
1721
classpath 'com.google.gms:google-services:4.1.0'
1822
classpath 'com.jakewharton:butterknife-gradle-plugin:8.6.0'
1923
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
24+
classpath 'io.fabric.tools:gradle:1.25.4'
2025

2126
// NOTE: Do not place your application dependencies here; they belong
2227
// in the individual module build.gradle files
@@ -30,6 +35,10 @@ allprojects {
3035
maven {
3136
url 'https://oss.sonatype.org/content/repositories/snapshots/'
3237
}
38+
maven {
39+
url 'https://maven.google.com/'
40+
}
41+
3342
}
3443
}
3544

0 commit comments

Comments
 (0)