Crosswalk on Android 4.1 - View freezes on input focus and deviceready not fired
While running an ionic App (Version beta 14 or 1.0 doesnt matter) with Crosswalk (version 10, 11, 12 make no difference) with following settings on Android 4.1:
- preference fullscreen set to true
- ionic.platform.isFullscreen = true
Screen freezes as soon as you focus an input field. Keyboard shows and closes on touch. You can actually still work with the app. So i can actually type in something in an input field and switch the view, only that i dont see anything. When i put the app in backgruond and resume it i will see the changes and the app runs as expected until i focus an input field again.
Solutions:
- android:windowSoftInputMode="adjustNothing" (adjustResize and adjustPan won't work)
or
- updated sdk to 22 and set this as targetSdk
- set android:windowSoftInputMode="adjustResize" again and most importantly:
- in ionic\platforms\android\src\org\crosswalk\engine\XWalkCordovaWebView.java add
XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, false);
AND
XWalkPreferences.setValue("support-multiple-windows", false);
to the static block at the end.
See the logcat for details. The console logs at the end starting with "deviceready not fired after 5 seconds" still show up with both solutions (well lets say the one solution, because adjustNothing isnt really a solution...)
LOGCAT:
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.
See this thread with a detailed explanation: http://forum.ionicframework.com/t/ionic-with-crosswalk-on-android-app-freeze-deviceready-not-fired-also-with-ionic-starter-tabs-project/19360
Similar Crosswalk bug: https://crosswalk-project.org/jira/browse/XWALK-3200
@kryptikal I dont have an Android 4.1 device to test with. However, on my emulator for 4.1, it works just fine.
Are you still having the issue?
Are you using the cordova file plugin? I've heard from another user that causes issues.
If you could also post the results from your ionic plugin ls that would help drill down to the issue.
Make sure you use the Genymotion emulator running 4.1.1 with Remote control enabled. I'm seeing the same thing. The whole app locks up. When I run adb logcat on it, it complains about a $timeout not being defined inside of ngCordova.
Not sure if this is related.
Here's the bit of info logcat gives me. I/chromium( 5033): [INFO:CONSOLE(8)] "Uncaught ReferenceError: $timeout is not defined", source: file:///android_asset/www/lib/ngCordova/dist/ng-cordova.min.js (8)
I had the same problem using Intel XDK Crosswalk build for a web application. kryptikal's suggestion (adjustNothing) worked for me, though I had to add the setting to the intelxdk.config.additions.xml and intelxdk.config.crosswalk.xml file.
Settings below:
<intelxdk:version value="1.0"/>
<intelxdk:cordova-cli version="4.1.2"/>
<preference name="android-minSdkVersion" value="14"/>
<preference name="android-targetSdkVersion" value="19"/>
<preference name="android-installLocation" value="auto"/>
<preference name="Fullscreen" value="true"/>
<preference name="Orientation" value="landscape"/>
<intelxdk:crosswalk version="11"/>
<preference name="debuggable" value="false"/>
<preference name="android-windowSoftInputMode" value="adjustNothing"/>
I had to edit engine/cordova-android-c0.6.1/bin/templates/project/AndroidManifest.xml manually after adding Crosswalk by changing the windowSoftInputMode to "adjustNothing" like so:
<activity android:name="__ACTIVITY__"
android:label="@string/activity_name"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Black.NoTitleBar"
android:windowSoftInputMode="adjustNothing"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Issue is resolved in Crosswalk 13+ and was a crosswalk issue rather than an ionic issue. In versions before use "XWalkPreferences.setValue(XWalkPreferences.ANIMATABLE_XWALK_VIEW, false);" as a solution in XWalkCordovaWebView.java
Can this be closed?
Hello all! Gonna go ahead and close this as it looks like the issue was a crosswalk bug and was resolved. If you still having this issue feel free to comment! Thanks for using Ionic!