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)