8

I am using Cordova CrossWebViewEngine and creating XWalkCordovaView to launch my app in webview. But it is throwing an error saying

    02-01 20:53:17.097: E/AndroidRuntime(2776): FATAL EXCEPTION: main
02-01 20:53:17.097: E/AndroidRuntime(2776): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.abc.securitySampleApp/com.abc.securitySampleApp.MainActivity}: java.lang.UnsupportedOperationException: load
02-01 20:53:17.097: E/AndroidRuntime(2776):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2059)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at android.os.Looper.loop(Looper.java:137)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at android.app.ActivityThread.main(ActivityThread.java:4745)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at java.lang.reflect.Method.invokeNative(Native Method)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at java.lang.reflect.Method.invoke(Method.java:511)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at dalvik.system.NativeStart.main(Native Method)
02-01 20:53:17.097: E/AndroidRuntime(2776): Caused by: java.lang.UnsupportedOperationException: load
02-01 20:53:17.097: E/AndroidRuntime(2776):     at org.xwalk.core.ReflectMethod.invoke(ReflectMethod.java:57)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at org.xwalk.core.XWalkView.load(XWalkView.java:281)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at com.abc.securitySampleApp.MainActivity.onCreate(MainActivity.java:55)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at android.app.Activity.performCreate(Activity.java:5008)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
02-01 20:53:17.097: E/AndroidRuntime(2776):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
02-01 20:53:17.097: E/AndroidRuntime(2776):     ... 11 more

Here is my code about launching the app

 CordovaWebViewEngine cordovawebviewEngine = super.makeWebViewEngine();
 XWalkWebViewEngine xwe = (XWalkWebViewEngine) cordovawebviewEngine;
 XWalkCordovaView swv = (XWalkCordovaView) xwe.getView();        
 swv.load(launchUrl,null);

Has anyone faced similar error or issue with Cordova Cross-Walk?

Edit: I tried changing my code to get XWalkView

xWalkWebView = new XWalkView(this.getApplicationContext(), this);
xWalkWebView.load(launchUrl, null);

I still get the same exception java.lang.UnsupportedOperationException

Update - 02/09/2016 I changed my main activity to extend XWalkActivity and now I have to implement a method onXWalkReady - the code looks like below

@Override
protected void onXWalkReady() {
  xWalkWebView.load(launcUrl, null);
}

I don't get the same error as I mentioned in the main question, but I get following errors

Error while loading asset assets/icudtl.dat: java.io.FileNotFoundException: assets/icudtl.dat 

glUtilsParamSize: unknow param

Fatal signal 11 (SIGSEGV)
yogsma
  • 10,142
  • 31
  • 97
  • 154
  • Did you try fixing the issue by adding the user agent as stated here : http://stackoverflow.com/questions/32199128/change-the-user-agent-of-crosswalk-13-as-webview-in-cordova/32925922#32925922 ? – Zakaria Feb 01 '16 at 20:47
  • Otherwise, can you please paste a more complete stacktrace ? – Zakaria Feb 01 '16 at 20:49
  • I am not sure if this is a user-agent issue as this is saying about not identifying method load. – yogsma Feb 01 '16 at 20:55
  • 1
    I've found [this Jira issue](https://crosswalk-project.org/jira/browse/XWALK-4938). Apparently that exception is thrown if you try to call some operations before XWalk is ready. Not sure about load though, never integrated Cordova with XWalk yet. – Mister Smith Feb 05 '16 at 23:23
  • @yogsma: At which line getting issue? – ρяσѕρєя K Feb 08 '16 at 12:54
  • @ρяσѕρєяK - error is coming from where I am trying to load the URL. – yogsma Feb 08 '16 at 14:12

0 Answers0