Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.

Commit 6585c2c

Browse files
committed
[ADDED] [#17] Crashlytics library to the sample app.
Fixes #17
1 parent 9168343 commit 6585c2c

File tree

3 files changed

+80
-2
lines changed

3 files changed

+80
-2
lines changed

app/build.gradle

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
apply plugin: 'com.android.application'
22

3+
apply plugin: 'io.fabric'
4+
35
apply plugin: 'kotlin-android'
46

57
apply plugin: 'kotlin-android-extensions'
@@ -10,7 +12,7 @@ apply plugin: 'kotlin-kapt'
1012
android {
1113
compileSdkVersion rootProject.ext.androidCompileSdkVersion
1214
defaultConfig {
13-
applicationId "com.hossainkhan.android.demo"
15+
applicationId "com.hossainkhan.android.constraintlayout"
1416
minSdkVersion rootProject.ext.androidMinSdkVersion
1517
targetSdkVersion rootProject.ext.androidTargetSdkVersion
1618
versionCode 1
@@ -67,6 +69,14 @@ dependencies {
6769

6870
implementation "com.jakewharton.timber:timber:$rootProject.timberLibraryVersion"
6971

72+
// Crashlytics
73+
// https://firebase.google.com/docs/crashlytics/get-started
74+
implementation "com.crashlytics.sdk.android:crashlytics:$rootProject.crashlyticsVersion"
75+
76+
// Firebase Core
77+
// https://firebase.google.com/docs/android/setup
78+
implementation "com.google.firebase:firebase-core:$rootProject.firebaseVersion"
79+
7080
// Dagger
7181
// https://google.github.io/dagger/
7282
implementation "com.google.dagger:dagger:$rootProject.daggerVersion"
@@ -93,3 +103,7 @@ dependencies {
93103
})
94104
androidTestImplementation 'com.android.support.test:runner:1.0.2'
95105
}
106+
107+
// ADD THIS AT THE BOTTOM
108+
// https://firebase.google.com/docs/android/setup
109+
apply plugin: 'com.google.gms.google-services'

app/google-services.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"_____DEVELOPER_NOTE_____": "YOU MUST GENERATE YOUR OWN FIREBASE CONFIG AND DROP IT HERE.",
3+
"________________________": "____________________________________________________________",
4+
"project_info": {
5+
"project_number": "123",
6+
"firebase_url": "https://GENERATE-YOUR-CONFIG.firebaseio.com",
7+
"project_id": "GENERATE-YOUR-CONFIG",
8+
"storage_bucket": "GENERATE-YOUR-CONFIG.appspot.com"
9+
},
10+
"client": [
11+
{
12+
"client_info": {
13+
"mobilesdk_app_id": "1:123:android:123",
14+
"android_client_info": {
15+
"package_name": "com.hossainkhan.android.constraintlayout"
16+
}
17+
},
18+
"oauth_client": [
19+
{
20+
"client_id": "GENERATE-YOUR-CONFIG.apps.googleusercontent.com",
21+
"client_type": 3
22+
}
23+
],
24+
"api_key": [
25+
{
26+
"current_key": "GENERATE-YOUR-CONFIG"
27+
}
28+
],
29+
"services": {
30+
"analytics_service": {
31+
"status": 1
32+
},
33+
"appinvite_service": {
34+
"status": 1,
35+
"other_platform_oauth_client": []
36+
},
37+
"ads_service": {
38+
"status": 2
39+
}
40+
}
41+
}
42+
],
43+
"configuration_version": "1"
44+
}

build.gradle

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,30 @@ buildscript {
1717
*/
1818
ext.androidGradleToolsVersion = '3.1.2'
1919

20+
/*
21+
* Fabric/Firebase gradle tools version.
22+
* https://firebase.google.com/docs/crashlytics/
23+
*/
24+
ext.fabricGradleToolsVersion = '1.25.1'
25+
26+
/*
27+
* Google play services plugin
28+
* https://firebase.google.com/docs/android/setup
29+
*/
30+
ext.googlePlayServicesToolsVersion = '3.3.1'
31+
2032
repositories {
2133
google()
2234
jcenter()
35+
maven {
36+
url 'https://maven.fabric.io/public'
37+
}
2338
}
2439
dependencies {
2540
classpath "com.android.tools.build:gradle:$androidGradleToolsVersion"
2641
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
42+
classpath "io.fabric.tools:gradle:$fabricGradleToolsVersion"
43+
classpath "com.google.gms:google-services:$googlePlayServicesToolsVersion"
2744

2845
// NOTE: Do not place your application dependencies here; they belong
2946
// in the individual module build.gradle files
@@ -63,6 +80,10 @@ ext {
6380
constraintLayoutVersion = '1.1.0'
6481
// https://developer.android.com/topic/libraries/architecture/adding-components
6582
archComponentVersion = '1.1.1'
83+
// https://firebase.google.com/docs/android/setup
84+
firebaseVersion = '15.0.2'
85+
// https://firebase.google.com/docs/crashlytics/get-started
86+
crashlyticsVersion = '2.9.2'
6687

6788
// Unit test dependencies
6889
// --------------------------------------------------
@@ -79,7 +100,6 @@ ext {
79100
flashBarVersion = '1.0.1' // https://github.com/aritraroy/Flashbar/releases
80101
}
81102

82-
83103
//
84104
// Utility methods used in the build
85105
//

0 commit comments

Comments
 (0)