Hello,
How do i get trace for javascript error which occur in native builds ( ios, android). JS error are shown in logs as
JS Error: error message
but crashlytics does not understand this as error. To log this type of error we tried to manually log error in
Scriptingcore.cpp’s js_log function as
if(strstr(_js_log_buf,"Error")){
crashlytics_context->log(crashlytics_context,_js_log_buf);
cocos2d::JniMethodInfo t;
if(cocos2d::JniHelper::getStaticMethodInfo(t, "org/cocos2dx/javascript/Analytics", "flushCrashLogs", "()V"))
{
t.env->CallStaticVoidMethod(t.classID, t.methodID);
t.env->DeleteLocalRef(t.classID);
}
}
and in flushCrashlogs we throw a non-fatal exception so the log is pushed to crashlytics.
but using this method we are not able to get stacktrace.
So can someone help us finding a better approach for tracking js error in native such that we can get stacktrace and local variable?
Thank you