mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-28 01:45:55 +08:00
Add crashanalytics
This commit is contained in:
@ -53,6 +53,12 @@ dependencies {
|
||||
|
||||
// For reading a file to string
|
||||
implementation 'commons-io:commons-io:2.5'
|
||||
|
||||
// Check for v11.4.2 or higher
|
||||
implementation 'com.google.firebase:firebase-core:16.0.6'
|
||||
|
||||
// Add dependency
|
||||
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
|
||||
}
|
||||
|
||||
configurations {
|
||||
@ -61,4 +67,5 @@ configurations {
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'com.google.gms.google-services'
|
||||
apply plugin: 'io.fabric'
|
||||
|
@ -2,11 +2,17 @@ buildscript {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
||||
// For Crashanalytics
|
||||
maven {
|
||||
url 'https://maven.fabric.io/public'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.2.1'
|
||||
classpath 'com.google.gms:google-services:4.2.0'
|
||||
classpath 'io.fabric.tools:gradle:1.26.1'
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,6 +20,10 @@ allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
||||
maven {
|
||||
url 'https://maven.google.com/'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
|
||||
|
@ -1,10 +1,34 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:flutter_crashlytics/flutter_crashlytics.dart';
|
||||
|
||||
import 'package:journal/app.dart';
|
||||
import 'package:journal/state_container.dart';
|
||||
|
||||
void main() async {
|
||||
bool isInDebugMode = true;
|
||||
|
||||
FlutterError.onError = (FlutterErrorDetails details) {
|
||||
if (isInDebugMode) {
|
||||
FlutterError.dumpErrorToConsole(details);
|
||||
} else {
|
||||
Zone.current.handleUncaughtError(details.exception, details.stack);
|
||||
}
|
||||
};
|
||||
|
||||
await FlutterCrashlytics().initialize();
|
||||
|
||||
runZoned<Future<Null>>(() async {
|
||||
await runJournalApp();
|
||||
}, onError: (error, stackTrace) async {
|
||||
await FlutterCrashlytics()
|
||||
.reportCrash(error, stackTrace, forceCrash: false);
|
||||
});
|
||||
}
|
||||
|
||||
Future runJournalApp() async {
|
||||
var pref = await SharedPreferences.getInstance();
|
||||
var onBoardingCompleted = pref.getBool("onBoardingCompleted") ?? false;
|
||||
|
||||
|
@ -92,6 +92,13 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_crashlytics:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: flutter_crashlytics
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.0"
|
||||
flutter_launcher_icons:
|
||||
dependency: "direct dev"
|
||||
description:
|
||||
|
@ -9,6 +9,7 @@ dependencies:
|
||||
uuid: "^1.0.0"
|
||||
yaml: "^2.1.13"
|
||||
firebase_analytics: ^1.1.0
|
||||
flutter_crashlytics: ^0.2.0
|
||||
shared_preferences: ^0.4.3
|
||||
|
||||
dev_dependencies:
|
||||
|
Reference in New Issue
Block a user