Ionic with Crosswalk on Android - App Freeze / Deviceready not fired (also with ionic starter tabs project)

I have huge issues running my app with crosswalk on Android (4.1 especially).

I thought the size of my app could be the issue, but i tried it with a sample project. While my project still runs with ionic beta 14, i tested it with the newest release (1.0rc1) and the sample tabs project as well.

I think the main problem is the “deviceready has not fired after 5 seconds”.

I tried it with crosswalk 10, 11 and 12…

I tried to manually trigger the deviceready event with no luck.

A similar issue can be found here: https://crosswalk-project.org/jira/browse/XWALK-3200

Also tried the mentioned XWalk Preference settings.

Logcat is telling me this:

03-19 09:56:11.964: D/dalvikvm(1329): Trying to load lib /data/data/com.ionicframework.dev240570/lib/libxwalkcore.so 0x414967e0
03-19 09:56:12.054: D/dalvikvm(1329): Added shared lib /data/data/com.ionicframework.dev240570/lib/libxwalkcore.so 0x414967e0
03-19 09:56:12.094: I/LibraryLoader(1329): Time to load native libraries: 125 ms (timestamps 6595-6720)
03-19 09:56:12.094: I/LibraryLoader(1329): Expected native library version number "",actual native library version number ""
03-19 09:56:12.215: I/LibraryLoader(1329): Expected native library version number "",actual native library version number ""
03-19 09:56:12.215: I/chromium(1329): [INFO:library_loader_hooks.cc(108)] Chromium logging enabled: level = 0, default verbosity = 0
03-19 09:56:12.294: D/dalvikvm(1329): GREF has increased to 201
03-19 09:56:12.323: D/dalvikvm(1329): GC_CONCURRENT freed 349K, 4% free 10891K/11271K, paused 31ms+18ms, total 104ms
03-19 09:56:12.323: D/dalvikvm(1329): WAIT_FOR_CONCURRENT_GC blocked 6ms
03-19 09:56:12.334: I/BrowserStartupController(1329): Initializing chromium process, singleProcess=true
03-19 09:56:12.784: I/ResourceExtractor(1329): Extracting resource xwalk.pak
03-19 09:56:12.894: I/ResourceExtractor(1329): Extracting resource icudtl.dat
03-19 09:56:13.453: I/dalvikvm(1329): Could not find method android.media.AudioManager.getProperty, referenced from method org.chromium.media.AudioManagerAndroid.getAudioLowLatencyOutputFrameSize
03-19 09:56:13.453: W/dalvikvm(1329): VFY: unable to resolve virtual method 475: Landroid/media/AudioManager;.getProperty (Ljava/lang/String;)Ljava/lang/String;
03-19 09:56:13.463: D/dalvikvm(1329): VFY: replacing opcode 0x6e at 0x0004
03-19 09:56:13.463: I/dalvikvm(1329): Could not find method android.media.AudioManager.getProperty, referenced from method org.chromium.media.AudioManagerAndroid.getNativeOutputSampleRate
03-19 09:56:13.463: W/dalvikvm(1329): VFY: unable to resolve virtual method 475: Landroid/media/AudioManager;.getProperty (Ljava/lang/String;)Ljava/lang/String;
03-19 09:56:13.463: D/dalvikvm(1329): VFY: replacing opcode 0x6e at 0x000d
03-19 09:56:13.463: E/dalvikvm(1329): Could not find class 'android.bluetooth.BluetoothManager', referenced from method org.chromium.media.AudioManagerAndroid.hasBluetoothHeadset
03-19 09:56:13.463: W/dalvikvm(1329): VFY: unable to resolve check-cast 31 (Landroid/bluetooth/BluetoothManager;) in Lorg/chromium/media/AudioManagerAndroid;
03-19 09:56:13.463: D/dalvikvm(1329): VFY: replacing opcode 0x1f at 0x001d
03-19 09:56:13.493: W/AudioManagerAndroid(1329): Requires BLUETOOTH permission
03-19 09:56:13.503: D/libEGL(1329): loaded /system/lib/egl/libEGL_emulation.so
03-19 09:56:13.513: D/(1329): HostConnection::get() New Host Connection established 0x2a117f40, tid 1329
03-19 09:56:13.513: D/libEGL(1329): loaded /system/lib/egl/libGLESv1_CM_emulation.so
03-19 09:56:13.523: D/libEGL(1329): loaded /system/lib/egl/libGLESv2_emulation.so
03-19 09:56:13.714: W/chromium(1329): [WARNING:proxy_service.cc(899)] PAC support disabled because there is no system implementation
03-19 09:56:13.854: I/dalvikvm(1329): Failed resolving Lorg/xwalk/core/internal/extension/api/DisplayManagerJBMR1; interface 123 'Landroid/hardware/display/DisplayManager$DisplayListener;'
03-19 09:56:13.854: W/dalvikvm(1329): Link of class 'Lorg/xwalk/core/internal/extension/api/DisplayManagerJBMR1;' failed
03-19 09:56:13.854: E/dalvikvm(1329): Could not find class 'org.xwalk.core.internal.extension.api.DisplayManagerJBMR1', referenced from method org.xwalk.core.internal.extension.api.XWalkDisplayManager.getInstance
03-19 09:56:13.854: W/dalvikvm(1329): VFY: unable to resolve new-instance 1578 (Lorg/xwalk/core/internal/extension/api/DisplayManagerJBMR1;) in Lorg/xwalk/core/internal/extension/api/XWalkDisplayManager;
03-19 09:56:13.854: D/dalvikvm(1329): VFY: replacing opcode 0x22 at 0x0026
03-19 09:56:13.864: I/dalvikvm(1329): Failed resolving Lorg/xwalk/core/internal/extension/api/DisplayManagerJBMR1; interface 123 'Landroid/hardware/display/DisplayManager$DisplayListener;'
03-19 09:56:13.864: W/dalvikvm(1329): Link of class 'Lorg/xwalk/core/internal/extension/api/DisplayManagerJBMR1;' failed
03-19 09:56:13.864: D/dalvikvm(1329): DexOpt: unable to opt direct call 0x2377 at 0x2a in Lorg/xwalk/core/internal/extension/api/XWalkDisplayManager;.getInstance
03-19 09:56:13.924: I/dalvikvm(1329): Could not find method android.view.Display.getName, referenced from method org.xwalk.core.internal.extension.api.device_capabilities.DeviceCapabilitiesDisplay.convertDisplayToJSON
03-19 09:56:13.934: W/dalvikvm(1329): VFY: unable to resolve virtual method 893: Landroid/view/Display;.getName ()Ljava/lang/String;
03-19 09:56:13.934: D/dalvikvm(1329): VFY: replacing opcode 0x6e at 0x002e
03-19 09:56:13.934: D/dalvikvm(1329): GC_CONCURRENT freed 309K, 4% free 11025K/11399K, paused 15ms+19ms, total 54ms
03-19 09:56:13.934: I/dalvikvm(1329): Could not find method android.os.StatFs.getBlockSizeLong, referenced from method org.xwalk.core.internal.extension.api.device_capabilities.DeviceCapabilitiesStorage$StorageUnit.updateCapacity
03-19 09:56:13.944: W/dalvikvm(1329): VFY: unable to resolve virtual method 761: Landroid/os/StatFs;.getBlockSizeLong ()J
03-19 09:56:13.944: D/dalvikvm(1329): VFY: replacing opcode 0x6e at 0x0014
03-19 09:56:13.964: W/ApplicationContext(1329): Unable to create external cache directory
03-19 09:56:13.994: D/XWalkCordovaWebView(1329): >>> loadUrl(file:///android_asset/www/index.html)
03-19 09:56:13.994: D/PluginManager(1329): init()
03-19 09:56:13.994: E/chromium(1329): [ERROR:unix_domain_server_socket_posix.cc(106)] Not implemented reached in virtual int net::UnixDomainServerSocket::GetLocalAddress(net::IPEndPoint*) const
03-19 09:56:14.094: I/chromium(1329): [INFO:xwalk_extension_renderer_controller.cc(47)] EXTENSION PROCESS DISABLED.
03-19 09:56:14.134: D/CordovaActivity(1329): Resumed the activity.
03-19 09:56:14.174: I/dalvikvm(1329): Failed resolving Lorg/chromium/content/browser/ScreenOrientationListener$ScreenOrientationDisplayListener; interface 123 'Landroid/hardware/display/DisplayManager$DisplayListener;'
03-19 09:56:14.174: W/dalvikvm(1329): Link of class 'Lorg/chromium/content/browser/ScreenOrientationListener$ScreenOrientationDisplayListener;' failed
03-19 09:56:14.174: E/dalvikvm(1329): Could not find class 'org.chromium.content.browser.ScreenOrientationListener$ScreenOrientationDisplayListener', referenced from method org.chromium.content.browser.ScreenOrientationListener.<init>
03-19 09:56:14.184: W/dalvikvm(1329): VFY: unable to resolve new-instance 1000 (Lorg/chromium/content/browser/ScreenOrientationListener$ScreenOrientationDisplayListener;) in Lorg/chromium/content/browser/ScreenOrientationListener;
03-19 09:56:14.184: D/dalvikvm(1329): VFY: replacing opcode 0x22 at 0x0011
03-19 09:56:14.184: I/dalvikvm(1329): Failed resolving Lorg/chromium/content/browser/ScreenOrientationListener$ScreenOrientationDisplayListener; interface 123 'Landroid/hardware/display/DisplayManager$DisplayListener;'
03-19 09:56:14.194: W/dalvikvm(1329): Link of class 'Lorg/chromium/content/browser/ScreenOrientationListener$ScreenOrientationDisplayListener;' failed
03-19 09:56:14.194: D/dalvikvm(1329): DexOpt: unable to opt direct call 0x12cd at 0x13 in Lorg/chromium/content/browser/ScreenOrientationListener;.<init>
03-19 09:56:14.297: W/EGL_emulation(1329): eglSurfaceAttrib not implemented
03-19 09:56:14.304: D/OpenGLRenderer(1329): Enabling debug mode 0
03-19 09:56:14.435: I/ActivityManager(151): Displayed com.ionicframework.dev240570/.MainActivity: +2s969ms
03-19 09:56:14.444: D/AndroidRuntime(1319): Shutting down VM
03-19 09:56:14.453: D/dalvikvm(1319): GC_CONCURRENT freed 103K, 76% free 492K/2048K, paused 1ms+1ms, total 10ms
03-19 09:56:14.463: D/dalvikvm(1319): Debugger has detached; object registry had 1 entries
03-19 09:56:14.473: D/(1329): HostConnection::get() New Host Connection established 0x2a22e320, tid 1359
03-19 09:56:14.493: I/AndroidRuntime(1319): NOTE: attach of thread 'Binder_3' failed
03-19 09:56:14.734: E/EGL_emulation(1329): eglQuerySurface 30be  EGL_BAD_ATTRIBUTE
03-19 09:56:14.924: I/dalvikvm(1329): Could not find method android.os.HandlerThread.quitSafely, referenced from method org.chromium.base.JavaHandlerThread.stop
03-19 09:56:14.924: W/dalvikvm(1329): VFY: unable to resolve virtual method 698: Landroid/os/HandlerThread;.quitSafely ()Z
03-19 09:56:14.924: D/dalvikvm(1329): VFY: replacing opcode 0x6e at 0x0018
03-19 09:56:14.964: D/CordovaActivity(1329): onMessage(onPageStarted,file:///android_asset/www/index.html)
03-19 09:56:15.234: W/BindingManager(1329): Cannot call determinedVisibility() - never saw a connection for the pid: 1329
03-19 09:56:16.274: D/dalvikvm(1329): GC_CONCURRENT freed 340K, 4% free 11101K/11527K, paused 16ms+3ms, total 174ms
03-19 09:56:19.874: D/JsMessageQueue(1329): Set native->JS mode to OnlineEventsBridgeMode
03-19 09:56:22.314: W/BindingManager(1329): Cannot call determinedVisibility() - never saw a connection for the pid: 1329
03-19 09:56:22.664: D/XWalkCordovaWebViewClient(1329): onPageFinished(file:///android_asset/www/index.html#/tab/dash)
03-19 09:56:22.664: D/CordovaActivity(1329): onMessage(onPageFinished,file:///android_asset/www/index.html#/tab/dash)
03-19 09:56:26.033: I/chromium(1329): [INFO:CONSOLE(1183)] "deviceready has not fired after 5 seconds.", source: file:///android_asset/www/cordova.js (1183)
03-19 09:56:26.043: I/chromium(1329): [INFO:CONSOLE(1176)] "Channel not fired: onPluginsReady", source: file:///android_asset/www/cordova.js (1176)
03-19 09:56:26.043: I/chromium(1329): [INFO:CONSOLE(1176)] "Channel not fired: onCordovaReady", source: file:///android_asset/www/cordova.js (1176)

Anyone have similar issues? Any way for the ionic team to reproduce and fix this?

1 Like

Only solution i found so far is to set android:windowSoftInputMode="adjustNothing"
“adjustResize” and “adjustPan” doesn’t work. Both lead to the issues above.

Am i the only one with this issue or am i the only one who tested crosswalk on Android 4.1 since it seems to be on ALL devices including Emulator.

Hmm, what version of crosswalk are you pulling down?
What other plugins do you have installed?
It maybe a case that you have some plugins that need to be updated by their maintainers for the new version of cordova-android that is required for crosswalk.

Maybe @jbavari1 could help shed some light on this?

Hi, as i said, i also tried it with one of your starter templates (the tabs project) with exactly the same outcome. I uninstalled all optional plugins and tried crosswalk versions 10, 11 and the beta one.

But i found a solution thats working good for me now. Actually its a combination of things i tested, so its nothing really “new” (its mentioned in the xwalk bug tracker link in my initial post). but i tried one after another instead all at once as i should have right from the beginning…

My app needs this settings, so i couldnt change this really:

  • latest stable crosswalk version
  • preference fullscreen set to true
  • ionic.platform.isFullscreen = true

just saying cause the problem doesnt occure if youre not running in fullscreen mode (have to recheck that again)

What i did to solve the problem was:

  • updated my sdk to 22 and set this as targetSdk

  • set android:windowSoftInputMode=“adjustResize” again

  • upgraded to latest ionic version (that actually doesnt matter, but i just say it cause it doesnt make a difference if you use ionic 1 or beta 14 for example)

  • in ionic\platforms\android\src\org\crosswalk\engine\XWalkCordovaWebView.java i added XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, false);
    AND
    XWalkPreferences.setValue("support-multiple-windows", false);
    to the static block at the end.

i still get the deviceready has not fired message but everythings working as expected right now.

alright, would you mind posting this thread and a link to the crosswalk issue on our cli issue tracker?

Okay i did that.
Is linking to this thread enough or do you want me to summarize all posts of this thread in the bug i just opened in your issue tracker?

If you don’t mind leaving a summary, that will help josh a lot

I don’t mind.

:smile:

btw: great job with ionic so far. continue.