Akash Singh
Akash Singh

Reputation: 21

Importing a cordova application to crosswalk

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); }

Upvotes: 2

Views: 1968

Answers (2)

Ye Liu
Ye Liu

Reputation: 8976

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

Upvotes: 1

Jamie
Jamie

Reputation: 81

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

Upvotes: 2

Related Questions