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

JIRA | Victor Kurochkin | 4 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 | 4 months ago | Victor Kurochkin
    junit.framework.AssertionFailedError: Cannot call this method before xwalk is ready
  2. 0

    Crosswalk crashes with AssertionFailedError

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

    How to verify IntentService start

    Stack Overflow | 1 year 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[...]])
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Unable to run unit test in GGTS 3.2 with grails 2.2.1

    Stack Overflow | 4 years ago | Qingxin Xu
    junit.framework.AssertionFailedError: Implement me
  6. 0

    selenium web driver - css selector having variable and # gives error

    Stack Overflow | 5 years ago | SUM
    junit.framework.AssertionFailedError: timeout

    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