junit.framework.AssertionFailedError

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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.
    via by David Buchan-Swanson,
  • Crosswalk crashes with AssertionFailedError
    via Stack Overflow by azlisum
    ,
  • 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}
    via by Victor Kurochkin,
  • How to verify IntentService start
    via Stack Overflow by Kamil Seweryn
    ,
  • Robotium on testdroid
    via Stack Overflow by Vinod Kollipara
    ,
  • ImageButtons are not found Robotium Android
    via Stack Overflow by eric
    ,
    • 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)

    Users with the same issue

    Adrien
    9 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Casper
    2 times, last one,
    27 more bugmates