Crash Reporting
To send crash reports, 101XP SDK uses Firebase Crashlytics.
Configure
To use Firebase Crashlytics in Android Studio:
- Add the file google-services.json in the application directory. Please ask your release manager for that file.
- Add Crashlytics plugin and Google Services plugin in the file build.gradle (root-level):
dependencies {
classpath 'com.google.gms:google-services:3.2.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.4.1'
}
- Add firebase plugin and dependencies in the file app/build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics'
dependencies {
implementation 'com.google.firebase:firebase-crashlytics:17.3.0'
}
apply plugin: 'com.google.gms.google-services'
Using (optional)
To send the crash report use method Platform101XP.crashReport(). Pass an exception to the method as the argument.
try {
// some code
} catch (Exception e) {
Platform101XP.sendCrashReport(e);
}
To log a message that will appear in a subsequent crash report use method Platform.crashLog(). Pass the message tag and the text message to the method. The message tag and the text message will be shown in the logcat.
Platform101XP.crashLog("MY TAG", "Show first log !");
Configure NDK (optional)
If you need to send a crash report from ndk, please add the Firebase Crashlytics NDK dependency and add the firebaseCrashlytics extension and make sure to enable the nativeSymbolUploadEnabled flag in the file app/build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.crashlytics''
dependencies {
implementation 'com.google.firebase:firebase-crashlytics-ndk:17.3.0'
}
android {
buildTypes {
release {
firebaseCrashlytics {
nativeSymbolUploadEnabled true
}
}
}
}
apply plugin: 'com.google.gms.google-services'