Crosswalk 使 Visual Studio Android Emulator 崩溃

问题描述:

这段代码;

public class MainActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       setContentView(R.layout.activity_main);
    }
}

还有这个布局;

<org.xwalk.core.XWalkView  xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/webview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
/>

似乎成功执行,但之后,我假设显示,导致 Visual Studio Android 模拟器崩溃;

Seems to succesfully execute, but then afterwards, I'm presuming on display, results in the Visual Studio Android Emulator crashing with;

02-11 13:31:26.390 17274-17274/in.atqu.androidtest A/libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 17274 (tqu.androidtest)

我另外确定它;

  • 不会在我本地连接的 ARM 设备上崩溃
  • 不会在 Android SDK 模拟器上崩溃
  • 如果使用 WebView 而不是 XWalkView
  • 不会崩溃
  • 如果评论`setContentView(R.layout.activity_main) 不会崩溃
  • 如果 XWalkView 被初始化/加载,仍然会崩溃
  • 如果将 Activity 切换到 XWalkActivity
  • 仍然会崩溃
  • Does not crash on my locally attached ARM device
  • Does not crash on Android SDK Emulator
  • Does not crash if WebView is used instead of XWalkView
  • Does not crash if `setContentView(R.layout.activity_main) is commented
  • Still crashes if the XWalkView is initialized/loaded
  • Still crashes if the Activity is switched to XWalkActivity

我想确定是否;

  1. 这可以修复;
  2. 这只是 Visual Studio Android 模拟器的一个问题,或者;
  3. 此症状是否会出现在 x86 硬件 现在没有理由假设 - 它在 x86 Android SDK 模拟器上运行

现在是 2016 年,它仍然是一个众所周知的问题,所以这个库似乎仍处于 x86 模拟器的测试阶段.请记住,这个问题确实是模拟器唯一的问题.在真正的 (ARM) android 手机上,crosswalk 应用程序会运行得很好.解决方案之一确实是将模拟器切换为使用 ARM 映像(而不是基于 x86 Atom.您可能会失去一些加速)有趣的是,在 MacOSX 上运行 Android 模拟器适用于所有图像并且不会崩溃.在 Windows 和 Linux 上,它仍然会使模拟器崩溃,但还有另一种解决方法.切换到旧的人行横道图书馆:科尔多瓦插件添加科尔多瓦插件-crosswalk-webview --variable XWALK_VERSION="org.xwalk:xwalk_core_library:15+"(我希望对你来说还不算太晚).

its 2016 now and its still a well known issue so it seems this library is still in its beta phase for x86 emulator. bare in mind that this issue is indeed an emulator only issue. on a real (ARM) android phone the crosswalk app will run just fine. One of the solutions is indeed to switch the emulator to use an ARM image (rather than x86 Atom based. you might loose some acceleration) The funny thing is that running the Android emulator on MacOSX works well on all images and doesn't crash. On Windows and Linux it still crashes the emulator but there is another workaround. switch to older crosswalk library: cordova plugin add cordova-plugin-crosswalk-webview --variable XWALK_VERSION="org.xwalk:xwalk_core_library:15+" (I hope its not too late for you).