I'm using Firebase on android ndk (including Crashanalytics.h header). At first I can send logs to firabase, but when an error occurs in the application it is not possible to send the log in the function that identifies the error.
In JNI_Load
firebase::crashlytics::Initialize();
firebase::crashlytics::Log("Testing "); // Here it is sent normal to firebase
struct sigaction act;
act.sa_sigaction = handler;
sigemptyset(&act.sa_mask);
act.sa_flags = SA_SIGINFO;
sigaction(SIGSEGV, &act, &act_old);
void handler(int signum, siginfo_t* info, void* contextPtr)
{
ucontext* context = (ucontext_t*)contextPtr;
if (act_old.sa_sigaction)
act1_old.sa_sigaction(signum, info, contextPtr);
// logic here
firebase::crashlytics::Log(buffer); // Here it stops the code execution and doesn't insert anything else to firebase
}
Run code snippetExpand snippet
What is the right way to do this, I also tried to create a thread to execute this code. But still nothing is uploaded to firebase.
0 Replies