2
votes

I am trying to use crosswalk runtime libraries with a cordova project and I am following all the steps given in the crosswalk documentation for migrating an application to crosswalk, but when I launch ADT and import the application and build it using the crosswalk libraries, I get an error in loadUrl(launchUrl); line of the java file(error: unable to resolve launchUrl as a variable). the comment above it says it is set from the config.xml file line (

Here is code with error:

public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set by in config.xml loadUrl(launchUrl); }

2
that parameter value comes from the cordova config.xml and it is set at time of build. You can replace that with a hardcoded path or possibly something from crosswalk (not familiar with crosswalk)Dawson Loudon
I am trying to hardcode it to "file:///android_assets/www/index.html" as per the cordova documentation, but then after launching the app I get the directory or file not found error. And the same is happening for just cordova as well, even if I don't include the crosswalk runtime.Akash Singh

2 Answers

2
votes

Replace launchUrl with Config.getStartUrl()

The getStartUrl() call was replaced with launchUrl in July [1]. crosswalk must be using an older version of cordova.

[1] https://github.com/apache/cordova-android/commit/705991e5b037743e632934b3c6ee98976e18d3f8

1
votes

Crosswalk 7.x and 8.x won't work with Cordova 3.6. Replacing launchUrl with Config.getStartUrl() can get rid of compile errors, but the app won't run. In the case of my app, it gave me a blank screen.

The proper solution I found is to stay with Cordova 3.5, install it as the following:

$ npm install -g [email protected]

After downgrading to 3.5.x, re-generate the android app:

$ cordova platform rm android
$ cordova platform add android