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

JIRA | Victor Kurochkin | 5 months ago
  1. 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
  2. 0

    Crosswalk crashes with AssertionFailedError

    Stack Overflow | 5 months ago | azlisum
    junit.framework.AssertionFailedError: Cannot call this method before xwalk is ready
  3. 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
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    CrossWalk webview Rendering problems in Android Studio

    Stack Overflow | 2 weeks ago | Khandoker Anan
    junit.framework.AssertionFailedError: Cannot call this method before xwalk is ready
  6. 0

    How to verify IntentService start

    Stack Overflow | 2 years ago | Kamil Seweryn
    junit.framework.AssertionFailedError: Wanted to match 1 intents. Actually matched 0 intents. IntentMatcher: has component: has component with: class name: is "com.example.MyIntentService" package name: an instance of java.lang.String short class name: an instance of java.lang.String Matched intents:[] Recorded intents: -Intent { cmp=com.example/.SecondActivity (has extras) } handling packages:[[com.example]], extras:[Bundle[...]])

  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.addJavascriptInterface
    1. org.xwalk.core.XWalkView.addJavascriptInterface(XWalkView.java:475)
    1 frame
  4. com.roher.carservice
    MainActivity.onXWalkReady
    1. com.roher.carservice.MainActivity.onXWalkReady(MainActivity.java:217)
    1 frame
  5. org.xwalk.core
    XWalkLibraryLoader$ActivateTask.onPostExecute
    1. org.xwalk.core.XWalkActivity$2.run(XWalkActivity.java:122)
    2. org.xwalk.core.XWalkActivityDelegate.onActivateCompleted(XWalkActivityDelegate.java:179)
    3. org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:314)
    4. org.xwalk.core.XWalkLibraryLoader$ActivateTask.onPostExecute(XWalkLibraryLoader.java:277)
    4 frames
  6. Android Platform
    ActivityThread.main
    1. android.os.AsyncTask.finish(AsyncTask.java:632)
    2. android.os.AsyncTask.access$600(AsyncTask.java:177)
    3. android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645)
    4. android.os.Handler.dispatchMessage(Handler.java:110)
    5. android.os.Looper.loop(Looper.java:193)
    6. android.app.ActivityThread.main(ActivityThread.java:5299)
    6 frames
  7. Java RT
    Method.invoke
    1. java.lang.reflect.Method.invokeNative(Method.java)
    2. java.lang.reflect.Method.invoke(Method.java:515)
    2 frames
  8. Android
    ZygoteInit.main
    1. com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
    2. com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
    2 frames
  9. Android Platform
    NativeStart.main
    1. dalvik.system.NativeStart.main(NativeStart.java)
    1 frame