Android project with Unity JNI libraries crash after Crosswalk was added

百般思念 提交于 2019-12-06 16:18:06

It is a little late, but when I installed Crosswalk using this command, it worked:

cordova plugin add cordova-plugin-crosswalk-webview --variable XWALK_VERSION="15" --variable XWALK_MODE="lite"

Why; I don't know. However, I am almost sure that it is not about the mysterious "XW_Initialize" function as crosswalk gives similar warnings for non-Unity .so files as well (for me, at least).

EDIT:

Apparently, settings version to 15 is not necessary; just settings mode to Lite is enough:

cordova plugin add cordova-plugin-crosswalk-webview  --variable XWALK_MODE="lite"

I have had the same problem with crosswalk crashing when it reads Unity's libunity.so, but after being stuck on this for days I found a solution:

If Unity's library is loaded before crosswalk is loaded, crosswalk doesn't crash on it.

To achieve this you need to load Unity's library by calling

System.loadLibrary("unity");

before calling loadUrl(launchUrl); in your MainActivity's onCreate.

This worked on my setup with Cordova 7.0.1, Crosswalk webview plugin 2.3.0 and Unity 5.6.4p3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!