Techiio-author
Started by Prasanta DasSep 23, 2021

Open
Android NDK Crashanalytics error sending log to firebase. (C ++)

0 VIEWES 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 0 VIEWES SHARE

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

You must be Logged in to reply
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance