junit.framework.AssertionFailedError: Cannot call this method before xwalk is ready

JIRA | David Buchan-Swanson | 1 week ago
  1. 0

    Crosswalk crashes with AssertionFailedError

    Stack Overflow | 5 months ago | azlisum
    junit.framework.AssertionFailedError: Cannot call this method before xwalk is ready
  2. 0

    I'm not really sure what is causing this. It's only just started happening recently. The error is: ``` junit.framework.AssertionFailedError: Cannot call this method before xwalk is ready at junit.framework.Assert.fail(Assert.java:50) at org.xwalk.core.XWalkView.setZOrderOnTop(XWalkView.java:1271) at org.crosswalk.engine.XWalkWebViewEngine.initWebViewSettings(XWalkWebViewEngine.java:195) at org.crosswalk.engine.XWalkWebViewEngine.access$000(XWalkWebViewEngine.java:56) at org.crosswalk.engine.XWalkWebViewEngine$2.run(XWalkWebViewEngine.java:91) at org.xwalk.core.XWalkActivityDelegate.onActivateCompleted(XWalkActivityDelegate.java:179) at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:314) at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:277) at android.os.AsyncTask.finish(AsyncTask.java:636) at android.os.AsyncTask.access$500(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:653) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:145) at android.app.ActivityThread.main(ActivityThread.java:6939) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199) ``` It seems to happen only on reboot when the application is the default home screen. When the application crashes, the default launcher picker appears again, and choosing the application again will open it successfully. It seems some process is launching too early under particular circumstances, but as the application is just launching, I'm not sure how I'm meant to halt the execution of xwalk code from within Cordova.

    JIRA | 1 week ago | David Buchan-Swanson
    junit.framework.AssertionFailedError: Cannot call this method before xwalk is ready
  3. 0

    Reproduce Test Steps ==================== Launch the app Expected Outcome ================ The app has been launched successfully Actual Outcome ============== The app crashes with the following exception: {noformat} junit.framework.AssertionFailedError: Cannot call this method before xwalk is ready at junit.framework.Assert.fail(Assert.java:50) at org.xwalk.core.XWalkView.addJavascriptInterface(XWalkView.java:475) at com.roher.carservice.MainActivity.onXWalkReady(MainActivity.java:217) at org.xwalk.core.XWalkActivity$2.run(XWalkActivity.java:122) at org.xwalk.core.XWalkActivityDelegate.onActivateCompleted(XWalkActivityDelegate.java:179) at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:314) at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:277) at android.os.AsyncTask.finish(AsyncTask.java:632) at android.os.AsyncTask.access$600(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:5299) at java.lang.reflect.Method.invokeNative(Method.java) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645) at dalvik.system.NativeStart.main(NativeStart.java) {noformat} Test Case Source Code ===================== {code:java} package com.roher.carservice; import org.xwalk.core.JavascriptInterface; import org.xwalk.core.XWalkActivity; import org.xwalk.core.XWalkResourceClient; import org.xwalk.core.XWalkView; public class MainActivity extends XWalkActivity { private XWalkView webView; ... @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); webView = (XWalkView) findViewById(R.id.xwvMain); webView.setResourceClient(new MyResourceClient(webView, getPackageManager())); ... } @Override protected void onXWalkReady() { webView.addJavascriptInterface(new JsInterface(), "android"); // ^^^ crashes on this line ^^^ webView.load("file:///android_asset/index.html", null); } ... } {code}

    JIRA | 5 months ago | Victor Kurochkin
    junit.framework.AssertionFailedError: Cannot call this method before xwalk is ready
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Impacted Cases ============== Compatibility Matrix for Shared Crosswalk App Reproduce Test Steps ============== 1. Download usecase-embedding-android-tests app(also for Async verison) 2. launch the app and select a test case to run.(eg. XWalkView/XWalkViewWithSetInitialScale) Expected Outcome ================== The test app will running well Actual Outcome ================= The apk stopped and popup "Unfortunately, xxx has stopped" Test Builds =========== ||Version|| Test Device || Result|| |crosswalk 16.45.421.18 | ASUS MEMO PAD 8 | {color:green}PASS{color} | |crosswalk 17.46.448.1| ASUS MEMO PAD 8 | {color:red}FAIL{color} | Issue Analysis ============== 1. Error message: {code} D/org.xwalk.embedded.api.sample.XWalkViewWithSetInitialScale(17398): screenSize.x: 800 screenSize.y: 1216 D/AndroidRuntime(17398): Shutting down VM W/dalvikvm(17398): threadid=1: thread exiting with uncaught exception (group=0x437bf160) E/AndroidRuntime(17398): FATAL EXCEPTION: main E/AndroidRuntime(17398): Process: org.xwalk.embedded.api.sample, PID: 17398 E/AndroidRuntime(17398): java.lang.RuntimeException: java.lang.UnsupportedOperationException: class org.xwalk.core.XWalkView.getSettings E/AndroidRuntime(17398): at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:67) E/AndroidRuntime(17398): at org.xwalk.core.XWalkView.setInitialScale(XWalkView.java:765) E/AndroidRuntime(17398): at org.xwalk.embedded.api.sample.XWalkViewWithSetInitialScale.onXWalkReady(XWalkViewWithSetInitialScale.java:54) E/AndroidRuntime(17398): at org.xwalk.core.XWalkActivity$2.run(XWalkActivity.java:120) E/AndroidRuntime(17398): at org.xwalk.core.XWalkActivityDelegate.onActivateCompleted(XWalkActivityDelegate.java:130) E/AndroidRuntime(17398): at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:294) E/AndroidRuntime(17398): at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:257) E/AndroidRuntime(17398): at android.os.AsyncTask.finish(AsyncTask.java:632) E/AndroidRuntime(17398): at android.os.AsyncTask.access$600(AsyncTask.java:177) E/AndroidRuntime(17398): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) E/AndroidRuntime(17398): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(17398): at android.os.Looper.loop(Looper.java:149) E/AndroidRuntime(17398): at android.app.ActivityThread.main(ActivityThread.java:5061) E/AndroidRuntime(17398): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(17398): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime(17398): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788) E/AndroidRuntime(17398): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604) E/AndroidRuntime(17398): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(17398): Caused by: java.lang.UnsupportedOperationException: class org.xwalk.core.XWalkView.getSettings E/AndroidRuntime(17398): at org.xwalk.core.internal.ReflectMethod.invoke(ReflectMethod.java:57) E/AndroidRuntime(17398): at org.xwalk.core.internal.XWalkViewBridge.getSettings(XWalkViewBridge.java:623) E/AndroidRuntime(17398): at org.xwalk.core.internal.XWalkViewInternal.setInitialScale(XWalkViewInternal.java:993) E/AndroidRuntime(17398): at org.xwalk.core.internal.XWalkViewBridge.setInitialScaleSuper(XWalkViewBridge.java:783) E/AndroidRuntime(17398): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(17398): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime(17398): at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:61) E/AndroidRuntime(17398): ... 17 more W/ActivityManager( 515): Force finishing activity org.xwalk.embedded.api.sample/.XWalkViewWithSetInitialScale W/ActivityManager( 515): Force finishing activity org.xwalk.embedded.api.sample/.XWalkEmbeddedAPISample D/WindowManager( 515): adjustConfigurationLw, config:{1.0 ?mcc?mnc ?locale ?layoutDir sw600dp w600dp h888dp 213dpi lrg port ?uimode ?night finger -keyb/v/h -nav/v} mLidState:1 mHasDockFeature:false mHasKeyboardFeature:false mHasHallSensorFeature:true config.hardKeyboardHidden:2 W/ActivityManager( 515): Activity pause timeout for ActivityRecord{21f671a8 u0 org.xwalk.embedded.api.sample/.XWalkViewWithSetInitialScale t330 f} {code} || Subjection || Name || Lib 16.45.421.18 || Lib 17.46.448.1 || | XWalkView | XWalkViewWithSetInitialScale | {color:green}PASS{color} | {color:red}FAIL{color} | | XWalkview-Extended | XWalkWithOnReceivedLoadError | {color:green}PASS{color} | {color:red}FAIL{color} | | XwalkUICilent & XwalkResourceClient | XWalkResourceClientAndXWalkUIClient | {color:green}PASS{color} | {color:red}FAIL{color} | | XwalkUICilent & XwalkResourceClient | XWalkViewWithClientReceivedSSLError | {color:green}PASS{color} | {color:red}FAIL{color} | | XwalkUICilent & XwalkResourceClient | XXalkViewWithRedirection | {color:green}PASS{color} | {color:red}FAIL{color} | | Misc | XXalkViewWithDownloadListener | {color:green}PASS{color} | {color:red}FAIL{color} | Remark: The test app is packaged with test branch 16 on SDK 16

    JIRA | 1 year ago | Jin, YingjunX
    java.lang.RuntimeException: java.lang.UnsupportedOperationException: class org.xwalk.core.XWalkView.getSettings
  6. 0

    Impacted Cases ============== Compatibility Matrix for Shared Crosswalk App Reproduce Test Steps ============== 1. Download usecase-embedding-android-tests app(also for Async verison) 2. launch the app and select a test case to run.(eg. XWalkView/XWalkViewWithSetInitialScale) Expected Outcome ================== The test app will running well Actual Outcome ================= The apk stopped and popup "Unfortunately, xxx has stopped" Test Builds =========== ||Version|| Test Device || Result|| |crosswalk 16.45.421.18 | ASUS MEMO PAD 8 | {color:green}PASS{color} | |crosswalk 17.46.448.1| ASUS MEMO PAD 8 | {color:red}FAIL{color} | Issue Analysis ============== 1. Error message: {code} D/org.xwalk.embedded.api.sample.XWalkViewWithSetInitialScale(17398): screenSize.x: 800 screenSize.y: 1216 D/AndroidRuntime(17398): Shutting down VM W/dalvikvm(17398): threadid=1: thread exiting with uncaught exception (group=0x437bf160) E/AndroidRuntime(17398): FATAL EXCEPTION: main E/AndroidRuntime(17398): Process: org.xwalk.embedded.api.sample, PID: 17398 E/AndroidRuntime(17398): java.lang.RuntimeException: java.lang.UnsupportedOperationException: class org.xwalk.core.XWalkView.getSettings E/AndroidRuntime(17398): at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:67) E/AndroidRuntime(17398): at org.xwalk.core.XWalkView.setInitialScale(XWalkView.java:765) E/AndroidRuntime(17398): at org.xwalk.embedded.api.sample.XWalkViewWithSetInitialScale.onXWalkReady(XWalkViewWithSetInitialScale.java:54) E/AndroidRuntime(17398): at org.xwalk.core.XWalkActivity$2.run(XWalkActivity.java:120) E/AndroidRuntime(17398): at org.xwalk.core.XWalkActivityDelegate.onActivateCompleted(XWalkActivityDelegate.java:130) E/AndroidRuntime(17398): at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:294) E/AndroidRuntime(17398): at org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:257) E/AndroidRuntime(17398): at android.os.AsyncTask.finish(AsyncTask.java:632) E/AndroidRuntime(17398): at android.os.AsyncTask.access$600(AsyncTask.java:177) E/AndroidRuntime(17398): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) E/AndroidRuntime(17398): at android.os.Handler.dispatchMessage(Handler.java:102) E/AndroidRuntime(17398): at android.os.Looper.loop(Looper.java:149) E/AndroidRuntime(17398): at android.app.ActivityThread.main(ActivityThread.java:5061) E/AndroidRuntime(17398): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(17398): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime(17398): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:788) E/AndroidRuntime(17398): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:604) E/AndroidRuntime(17398): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(17398): Caused by: java.lang.UnsupportedOperationException: class org.xwalk.core.XWalkView.getSettings E/AndroidRuntime(17398): at org.xwalk.core.internal.ReflectMethod.invoke(ReflectMethod.java:57) E/AndroidRuntime(17398): at org.xwalk.core.internal.XWalkViewBridge.getSettings(XWalkViewBridge.java:623) E/AndroidRuntime(17398): at org.xwalk.core.internal.XWalkViewInternal.setInitialScale(XWalkViewInternal.java:993) E/AndroidRuntime(17398): at org.xwalk.core.internal.XWalkViewBridge.setInitialScaleSuper(XWalkViewBridge.java:783) E/AndroidRuntime(17398): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(17398): at java.lang.reflect.Method.invoke(Method.java:515) E/AndroidRuntime(17398): at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:61) E/AndroidRuntime(17398): ... 17 more W/ActivityManager( 515): Force finishing activity org.xwalk.embedded.api.sample/.XWalkViewWithSetInitialScale W/ActivityManager( 515): Force finishing activity org.xwalk.embedded.api.sample/.XWalkEmbeddedAPISample D/WindowManager( 515): adjustConfigurationLw, config:{1.0 ?mcc?mnc ?locale ?layoutDir sw600dp w600dp h888dp 213dpi lrg port ?uimode ?night finger -keyb/v/h -nav/v} mLidState:1 mHasDockFeature:false mHasKeyboardFeature:false mHasHallSensorFeature:true config.hardKeyboardHidden:2 W/ActivityManager( 515): Activity pause timeout for ActivityRecord{21f671a8 u0 org.xwalk.embedded.api.sample/.XWalkViewWithSetInitialScale t330 f} {code} || Subjection || Name || Lib 16.45.421.18 || Lib 17.46.448.1 || | XWalkView | XWalkViewWithSetInitialScale | {color:green}PASS{color} | {color:red}FAIL{color} | | XWalkview-Extended | XWalkWithOnReceivedLoadError | {color:green}PASS{color} | {color:red}FAIL{color} | | XwalkUICilent & XwalkResourceClient | XWalkResourceClientAndXWalkUIClient | {color:green}PASS{color} | {color:red}FAIL{color} | | XwalkUICilent & XwalkResourceClient | XWalkViewWithClientReceivedSSLError | {color:green}PASS{color} | {color:red}FAIL{color} | | XwalkUICilent & XwalkResourceClient | XXalkViewWithRedirection | {color:green}PASS{color} | {color:red}FAIL{color} | | Misc | XXalkViewWithDownloadListener | {color:green}PASS{color} | {color:red}FAIL{color} | Remark: The test app is packaged with test branch 16 on SDK 16

    JIRA | 1 year ago | Jin, YingjunX
    java.lang.RuntimeException: java.lang.UnsupportedOperationException: class org.xwalk.core.XWalkView.getSettings

  1. andyglick 1 times, last 2 weeks ago
4 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. junit.framework.AssertionFailedError

    Cannot call this method before xwalk is ready

    at junit.framework.Assert.fail()
  2. JUnit
    Assert.fail
    1. junit.framework.Assert.fail(Assert.java:50)
    1 frame
  3. org.xwalk.core
    XWalkView.setZOrderOnTop
    1. org.xwalk.core.XWalkView.setZOrderOnTop(XWalkView.java:1271)
    1 frame
  4. org.crosswalk.engine
    XWalkWebViewEngine$2.run
    1. org.crosswalk.engine.XWalkWebViewEngine.initWebViewSettings(XWalkWebViewEngine.java:195)
    2. org.crosswalk.engine.XWalkWebViewEngine.access$000(XWalkWebViewEngine.java:56)
    3. org.crosswalk.engine.XWalkWebViewEngine$2.run(XWalkWebViewEngine.java:91)
    3 frames
  5. org.xwalk.core
    XWalkLibraryLoader$ActivateTask.onPostExecute
    1. org.xwalk.core.XWalkActivityDelegate.onActivateCompleted(XWalkActivityDelegate.java:179)
    2. org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:314)
    3. org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:277)
    3 frames
  6. Android Platform
    ActivityThread.main
    1. android.os.AsyncTask.finish(AsyncTask.java:636)
    2. android.os.AsyncTask.access$500(AsyncTask.java:177)
    3. android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:653)
    4. android.os.Handler.dispatchMessage(Handler.java:102)
    5. android.os.Looper.loop(Looper.java:145)
    6. android.app.ActivityThread.main(ActivityThread.java:6939)
    6 frames
  7. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invoke(Native Method)
    2. java.lang.reflect.Method.invoke(Method.java:372)
    2 frames
  8. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
    2 frames