You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by "Dmitry L." <di...@gmail.com> on 2019/07/21 17:31:06 UTC

How to handle weexcore crash?

Hello!

I have an app for Android, which user can start and then turns off the
screen so, app is still working (when user turns on the screen he should
see the app).

The problem is that user can turn on the screen after 6 hours (and more).
App works well, bu suddenly (after long time without activity) I got next
error:

==== logcat ====
07-21 03:05:04.844  3289  3294 I WeexCore:
[3289:3294:07-21/03:05:04.843898:INFO:crash_handler.cpp:166]CrashHandlerInfo::handleSignal
07-21 03:05:05.010  3207  3245 D jsengine: callReportCrashReloadPage
crashFile:/data/user/0/com.test.app/app_crash/crash_dump.log
==== /logcat ====

In this situation  (callReportCrashReloadPage) the weex engine have to be
reloaded, as I see in Android Weex SDK code ( here
android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java ).

But in my case I don't have bundleUrl (I provide js-template by myself via
renderPageByTemplate) and page is not being reloaded after crash.

So, the main question: how can I handle callReportCrashReloadPage and
reload page by myself?

-- 
//wbr, Dmitry L.

Re: How to handle weexcore crash?

Posted by 申远 <sh...@gmail.com>.
Actually* callReportCrashReloadPage* just sends a broadcast with bundleUrl
as its parameter. In your case, the bundleUrl is your pageName [2] , not a
real URL. If you can establish a mapping between pageName and your JS
template, you would solve the problem.

[1]
https://github.com/apache/incubator-weex/blob/1ee8c7432a10b47df454b4db5538dabeabd6c03c/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java#L1101-L1106
[2]
https://github.com/apache/incubator-weex/blob/1ee8c7432a10b47df454b4db5538dabeabd6c03c/android/sdk/src/main/java/com/taobao/weex/WXSDKInstance.java#L700

Best Regards,
YorkShen

申远


Dmitry L. <di...@gmail.com> 于2019年7月22日周一 上午1:31写道:

> Hello!
>
> I have an app for Android, which user can start and then turns off the
> screen so, app is still working (when user turns on the screen he should
> see the app).
>
> The problem is that user can turn on the screen after 6 hours (and more).
> App works well, bu suddenly (after long time without activity) I got next
> error:
>
> ==== logcat ====
> 07-21 03:05:04.844  3289  3294 I WeexCore:
>
> [3289:3294:07-21/03:05:04.843898:INFO:crash_handler.cpp:166]CrashHandlerInfo::handleSignal
> 07-21 03:05:05.010  3207  3245 D jsengine: callReportCrashReloadPage
> crashFile:/data/user/0/com.test.app/app_crash/crash_dump.log
> ==== /logcat ====
>
> In this situation  (callReportCrashReloadPage) the weex engine have to be
> reloaded, as I see in Android Weex SDK code ( here
> android/sdk/src/main/java/com/taobao/weex/bridge/WXBridgeManager.java ).
>
> But in my case I don't have bundleUrl (I provide js-template by myself via
> renderPageByTemplate) and page is not being reloaded after crash.
>
> So, the main question: how can I handle callReportCrashReloadPage and
> reload page by myself?
>
> --
> //wbr, Dmitry L.
>