ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Crosswalk on Android 4.1 - View freezes on input focus and deviceready not fired

Open malifai opened this issue 11 years ago • 7 comments

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. 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;. 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)

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

malifai avatar Mar 20 '15 16:03 malifai

@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.

jbavari avatar May 08 '15 21:05 jbavari

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)

ghost avatar May 14 '15 06:05 ghost

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"/>

acarlonvsn avatar May 15 '15 06:05 acarlonvsn

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>

ghost avatar May 25 '15 07:05 ghost

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

malifai avatar Jul 08 '15 09:07 malifai

Can this be closed?

baleboy avatar Aug 19 '15 10:08 baleboy

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!

jgw96 avatar May 02 '16 20:05 jgw96