Skip to content

0x03d Crash_en

hui.zhao edited this page Mar 27, 2020 · 5 revisions

Crash

Extra dependencies

AndroidGodEye's crash collection module depends on the open source project xCrash, so you need to add the dependency in your project, otherwise the crash module will fail to install (if you don't need the crash collection function, you can ignore this failure information and remove this dependency)

implementation 'cn.hikyson.godeye:godeye-xcrash:VERSION_NAME'

Support Java and native crash

If you have xCrash in your project, then it will has come conflicts with the xCrash config. Please delete this dependency and send crash info to Crash module of AndroidGodEye like this:

try {
    CrashInfo crashInfo = new CrashInfo();
    crashInfo.crashTime = FORMATTER_2.format(new Date());
    ...
    GodEye.instance().<Crash>getModule(GodEye.ModuleName.CRASH).produce(Arrays.asList(crashInfo));
} catch (UninstallException e) {
    e.printStackTrace();
}

Install

Use the following configuration to install

GodEye.instance().install(GodEyeConfig.defaultConfigBuilder().withCrashConfig(new GodEyeConfig.CrashConfig(false)).build());

or

<crash immediate="false"/>

immediate indicates whether to output crash immediately. If it is true, the crash will be output immediately in case of crash. If it is false, the crash will be output when crash module be installed next time. However, if the crash file is saved failed, it will be output immediately after crash regardless of 'immediate' configuration.

Production and consumption of data

Use the following methods to observe the output:

try {
           GodEye.instance().observeModule(GodEye.ModuleName.CRASH, (List<CrashInfo> crashInfos) -> {
                });
        } catch (UninstallException e) {
            e.printStackTrace();
        }

DebugMonitor Dashboard

android_god_eye_crash_summary

android_god_eye_crash_detail

Clone this wiki locally