I have integrated Huawei AGC crash service like in the official documentation but crashes do not appear in AppGallery Web Console. Any idea what I might be missing?
Please add the following code to your project to check the default crash handler, normally it should be "com.huawei.agconnect.crash", if the result is a third-party crash service, please try to disable it or contact with third-party for help.
Button btn_crash = findViewById(R.id.btn_crash);
btn_crash.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
final String clzName = getTheDefaultCrashHandler();
if(isAGCCrashHandler(clzName)){
AGConnectCrash.getInstance().testIt();
} else{
Toast.makeText(MainActivity.this,"the default crash handler is " + clzName,Toast.LENGTH_SHORT).show();
}
}
});
private boolean isAGCCrashHandler(String clz){
if(clz.startsWith("com.huawei.agconnect.crash")) {
return true;
}
return false;
}
private String getTheDefaultCrashHandler(){
Thread.UncaughtExceptionHandler defCrashHandler = Thread.getDefaultUncaughtExceptionHandler();
return defCrashHandler.getClass().getName();
}