You need to enable JavaScript to run this app.
Application Performance Management Plus

Application Performance Management Plus

Copy page
Download PDF
Android-side monitoring
Crashes are not reported
Copy page
Download PDF
Crashes are not reported
If the crash on the app side is not reported, first confirm that the service has been activated and the event quota has not been exhausted. After ruling out these two situations, you can troubleshoot the issue through the following methods.​
Method 1: Troubleshoot via logs​
  1. Before initializing MonitorCrash, turn on the log switch, call Npth.getConfigManager().setDebugMode(true), and filter the npth logs.​
  1. After turning on the log switch, the following configuration update logs will appear.​
  • ​
    2022-09-22 21:16:20.756 5319-5367/com.example.crash.test I/npth: update config 187277 : {"crash_module":{"alog_crash_before_time":"60","switcher":1,"upload_alog":"1"}}​
    2022-09-22 21:16:20.757 5319-5367/com.example.crash.test I/npth: after update aid 187277​
    ​
  • If the configuration update logs are not printed, check the following possible causes:​
  • If there are no logs corresponding to the aid, check whether the initialization code and configuration items are correct.​
  • Whether the network is working properly.​
  1. When a Java crash occurs, the following capture logs will be printed.​
  • ​
    I/npth: [uncaughtException] mLaunchCrashDisposer​
    ​
  • If the capture logs are not printed, check the following possible causes:​
  • Use Logcat logs to determine whether a crash actually occurred.​
  • If there is an error log with the FATAL keyword, then a crash did occur.​
  • If there is no error log with the FATAL keyword, check whether there is a global catch mechanism.​
  • Check whether UncaughtExceptionHandler is registered properly.​
  • Use the following sample code to iterate through and print the UncaughtExceptionHandler within the application. The APM package name is com.apm.insight.handler.​
  • If there are many handlers but no handler with the package name com.apm.insight appears in the log output, it means the handler was not registered properly. Initializing after the APM is recommended.​
  • Even when the handler is registered properly, some monitoring SDKs may not forward crashes. Initializing after the APM is recommended. When troubleshooting an unreported crash, you can comment out the corresponding SDK to verify.​
  • ​
    Thread.UncaughtExceptionHandler handler = Thread.getDefaultUncaughtExceptionHandler();​
    boolean next = false;​
    do {​
    System.out.println("UncaughtExceptionHandler " + handler.getClass().getName());​
    next = false;​
    Field[] fields = handler.getClass().getDeclaredFields();​
    for (Field field : fields) {​
    field.setAccessible(true);​
    try {​
    Object object = field.get(handler);​
    if (object instanceof Thread.UncaughtExceptionHandler) {​
    handler = (Thread.UncaughtExceptionHandler)object;​
    next = true;​
    break;​
    }​
    } catch (Exception e) {​
    e.printStackTrace();​
    }​
    }​
    } while (next);​
    ​
  1. When a Native crash occurs, the following capture logs will be printed.​
  • ​
    2022-09-22 21:33:05.023 8847-8847/com.example.crash.test E/npth: Native crash was detected!​
    2022-09-22 21:33:05.087 8847-8882/com.example.crash.test I/npth: [onNativeCrash] enter​
    ​
  • If the capture logs are not printed, check the following possible causes:​
  • Check whether the APK packaging of the .so files is normal, including libapminsighta.so and libapminsightb.so. If there is an anomaly, you need to repackage.​
  1. ANR currently has no capture logs. Once captured, the log will be reported directly.​
  • ​
    I/npth: uploadFromFile with allData [{"header":{"aid":"187277","update_version_code":1,"version_code":1,"app_version":"1.0","channel":"app_channel","device_id":"7550965448758202369","os":"Android","single_upload":0},"custom":{"app_custom":"app_value"},"filters":{"app_tag":"app_value"},"line_num":[{"start":0,"end":34}]},{"header":{"aid":"239017","update_version_code":123,"version_code":123,"app_version":"1.2.3","channel":"sdk_channel","package":["com.bytedance.testsdk1","com.example.crash.test"],"device_id":"7550965448758202369","os":"Android","so_list":["testsdk1.so"],"single_upload":0},"custom":{"sdk1_custom":"sdk1_value"},"filters":{"sdk1_tag":"sdk1_value"},"line_num":[{"start":14,"end":15},{"start":17,"end":21}]},{"header":{"aid":"1003","update_version_code":1,"version_code":1,"app_version":"1.1.1","package":["com.bytedance.testsdk3"],"device_id":"7550965448758202369","user_id":"1003","os":"Android","so_list":["testsdk3.so"],"single_upload":0},"custom":{"sdk3_custom":"sdk3_value"},"filters":{"sdk3_tag":"sdk3_value"},"line_num":[{"start":12,"end":14}]}]​
    ​
  • The uploaded logs for Java crashes and Native crashes are consistent. Check the following possible causes:​
  • Check whether allData contains aid. If not, analyze whether the stack matches the package name passed in during initialization.​
  • Check the network.​
Method 2: Troubleshoot via crash artifacts​
After a crash is successfully reported, the crash-related artifacts will be deleted. You need to obtain the crash artifacts after the crash occurs but before the report succeeds, and then check them.​
  1. Under data/data//files/apminsight on the device, obtain the related artifacts collected for the crash.​
  1. CrashLogJava stores exceptions such as Java crashes, Java startup crashes, and ANR, while CrashLogNative stores Native crashes.​
  • ​图片​​
  • If CrashLogNative is not generated, check whether initialization succeeded.​
  • If the crash path is empty, check whether initialization succeeded. Among them, ANR can be tested with the network disconnected.​
  • If all_data.json does not exist, check whether the crash stack does not match or there are issues with the configuration file.​
  • ​图片​​
  1. The restart file was not deleted.​
  • Check the network.​
  • Check whether the APK packaging of the .so files is normal, including libapminsighta.so and libapminsightb.so.​
Method 3: Troubleshoot via captured packets​
  1. HTTPS domain configuration (or simply set an HTTP domain).​
  • ​
    android:networkSecurityConfig="@xml/network_security_config"​
    配置增加火山域名​
    <domain includeSubdomains="true">https://apmplus.volces.com</domain>​
    ​
  1. Upload API.​
  • ​
    API​
    Meaning​
    /monitor/collect/c/crash​
    Java crash reporting, ANR, Dart exception​
    /monitor/collect/c/exception​
    Custom exception data reporting​
    /monitor/collect/c/native_bin_crash​
    Native crash reporting​
    monitor/collect/c/cloudcontrol/file​
    Alog reporting file​
    /settings/get​
    settings: Configuration fetch​
    /monitor/collect/c/exception/dump_collection​
    Startup crash reporting​
    ​
  1. The corresponding packets are captured, but they are still not displayed on the platform.​
  • Check whether the domain configuration is correct.​
Method 4: Troubleshoot using test tools​
​
​
test-release.zip
​
​
  1. After decompression, import it locally. You can copy the aar to the libs directory of the app's module, and then add it to the dependencies in the app's build.gradle.​
  • ​
    implementation files('libs/test-release.aar')​
    ​
  1. Compiling the apk will add a test entry. Click Test entry.​
  1. Enter the test page and select the test item.​
​
Last updated: 2026.10.23 11:17:26