From 3956f6aa0d6ca985674a6183b36f5096249af335 Mon Sep 17 00:00:00 2001 From: Thibault Deckers Date: Sun, 7 Jun 2020 16:38:18 +0900 Subject: [PATCH] added Firebase Crashlytics --- android/app/build.gradle | 3 ++ android/app/google-services.json | 69 ++++++++++++++++++++++++++++++++ android/build.gradle | 2 + lib/main.dart | 4 ++ lib/utils/constants.dart | 6 +++ pubspec.lock | 7 ++++ pubspec.yaml | 1 + 7 files changed, 92 insertions(+) create mode 100644 android/app/google-services.json diff --git a/android/app/build.gradle b/android/app/build.gradle index 4e157772d..0be62fa08 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -87,3 +87,6 @@ dependencies { compileOnly rootProject.findProject(':streams_channel') } + +apply plugin: 'com.google.gms.google-services' +apply plugin: 'com.google.firebase.crashlytics' diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 000000000..ca33c6d02 --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,69 @@ +{ + "project_info": { + "project_number": "100907092477", + "firebase_url": "https://aves-1564927220626.firebaseio.com", + "project_id": "aves-1564927220626", + "storage_bucket": "aves-1564927220626.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:100907092477:android:883192cb81028ac9ec7194", + "android_client_info": { + "package_name": "deckers.thibault.aves" + } + }, + "oauth_client": [ + { + "client_id": "100907092477-u7sm8gp5t2sotn42oq20ufhtn3craodu.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAsAb_CN9AxeT05jLGhdnNLFQ6U5esTjjY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "100907092477-u7sm8gp5t2sotn42oq20ufhtn3craodu.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + }, + { + "client_info": { + "mobilesdk_app_id": "1:100907092477:android:f3d6f758d2ed896aec7194", + "android_client_info": { + "package_name": "deckers.thibault.aves.debug" + } + }, + "oauth_client": [ + { + "client_id": "100907092477-u7sm8gp5t2sotn42oq20ufhtn3craodu.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyAsAb_CN9AxeT05jLGhdnNLFQ6U5esTjjY" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "100907092477-u7sm8gp5t2sotn42oq20ufhtn3craodu.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index c1bcd1abe..cb1faadbe 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,6 +6,8 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.6.3' + classpath 'com.google.gms:google-services:4.3.3' + classpath 'com.google.firebase:firebase-crashlytics-gradle:2.1.1' } } diff --git a/lib/main.dart b/lib/main.dart index 186c91360..d66259c8d 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,6 +8,7 @@ import 'package:aves/widgets/album/collection_page.dart'; import 'package:aves/widgets/common/data_providers/media_store_collection_provider.dart'; import 'package:aves/widgets/common/icons.dart'; import 'package:aves/widgets/fullscreen/fullscreen_page.dart'; +import 'package:firebase_crashlytics/firebase_crashlytics.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:pedantic/pedantic.dart'; @@ -17,6 +18,9 @@ import 'package:screen/screen.dart'; void main() { // HttpClient.enableTimelineLogging = true; // enable network traffic logging // debugPrintGestureArenaDiagnostics = true; + Crashlytics.instance.enableInDevMode = true; + + FlutterError.onError = Crashlytics.instance.recordFlutterError; runApp(AvesApp()); } diff --git a/lib/utils/constants.dart b/lib/utils/constants.dart index ec7ec04eb..12c5a96a0 100644 --- a/lib/utils/constants.dart +++ b/lib/utils/constants.dart @@ -89,6 +89,12 @@ class Constants { licenseUrl: 'https://github.com/Skylled/expansion_tile_card/blob/master/LICENSE', sourceUrl: 'https://github.com/Skylled/expansion_tile_card', ), + Dependency( + name: 'Firebase Crashlytics', + license: 'BSD 3-Clause', + licenseUrl: 'https://github.com/FirebaseExtended/flutterfire/blob/master/packages/firebase_crashlytics/LICENSE', + sourceUrl: 'https://github.com/FirebaseExtended/flutterfire/tree/master/packages/firebase_crashlytics', + ), Dependency( name: 'Flushbar', license: 'Apache 2.0', diff --git a/pubspec.lock b/pubspec.lock index 2669616d1..bc343c2ce 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -99,6 +99,13 @@ packages: relative: true source: path version: "1.0.3" + firebase_crashlytics: + dependency: "direct main" + description: + name: firebase_crashlytics + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.3+3" flushbar: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 91f3fc769..a32f296b9 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -47,6 +47,7 @@ dependencies: path: ../expansion_tile_card # git: # url: git://github.com/deckerst/expansion_tile_card.git + firebase_crashlytics: flushbar: flutter_ijkplayer: path: ../flutter_ijkplayer