2

I believe every version of Crosswalk Cordova I've downloaded from https://download.01.org/crosswalk/releases/crosswalk/android/ does not build successfully for me out of the box. I am following direct instructions from the Crosswalk wiki here but no luck even with the stable builds. The only time I was able to build successfully was when I read through each error on the command line and went through the java files necessary to comment some code that was causing the problem. However, since I am new to Crosswalk, I do not know the code base well enough to continue doing that, at least not reliably and carefully.

My main goal is to build the Crosswalk Cordova sample project so that I can replace the assets code with my web app that I already created. Has anyone had luck with this? Could anyone share a very stable build that builds successfully out the box?

Thanks

Martavis P.
  • 1,708
  • 2
  • 27
  • 45

6 Answers6

4

I had trouble using the crosswalk examples as well. You should check out the POC Joe Bowser published here: https://github.com/infil00p/cordova-android/tree/pluggable_webview

note that it is contained in the pluggable_webview branch --edit--

You install the crosswalk browser through PlugMan from this repo: https://github.com/infil00p/cordova-crosswalk-engine

note that the xwalk engine itself is not included in either repo. The plugin repo provides the hooks, the cordova fork provides the functionality to swap webviews.

Joe is a core Cordova team member and created a crosswalk-cordova demo which does work (I've tested it myself).

Lorenzo

Lorenzo
  • 413
  • 2
  • 8
  • Thanks so much! This has been very frustrating. I will try this out first thing tomorrow and let you know how it goes. – Martavis P. Apr 16 '14 at 03:49
  • I believe I am on the right path but back to an original problem, I can't find a zip from Crosswalk that contains an xwalk_core_library folder that does not contain errors. I'm using the crosswalk-cordova-4.32.76.6-x86 stable release and there are all kinds of errors coming from Eclipse. I also cannot download any stable version before because they took them down and all other releases (canary and beta) don't seem to have the necessary files that the crosswalk engine needs. Do you have a "real" stable version of the xwalk_core_library that works with this? – Martavis P. Apr 16 '14 at 18:22
  • Nevermind that last comment. I had to do plenty of digging to find which files were missing from the stable build. I needed to check the other beta builds that are available. Turned out the errors were from missing R.java files. Thank you so much for your help! My app is finally running with Crosswalk!!!! – Martavis P. Apr 16 '14 at 19:25
2

you can reference here (https://crosswalk-project.org/#wiki/Add-Plugins-With-Crosswalk-Cordova-Android) on how to add more plug-ins. most of plug-in should just work and if not, please feel free to report the issue to us, either via the JIRA system: https://crosswalk-project.org/jira/secure/Dashboard.jspa or via Crosswalk community support such as crosswalk mailing list

  • Thanks so much! This worked! the only thing that changed is the statusbar is now showing. I'm trying to figure this out now. – Martavis P. Apr 18 '14 at 17:48
  • Figured it out. It's an Android thing that must be done in the Android Manifest.xml file. Must use android:theme="@android:style/Theme.NoTitleBar.Fullscreen" inside the Activity section. – Martavis P. Apr 21 '14 at 21:18
1

Sorry for the confusion and thanks for trying to build Cordova App with Crosswalk.

As today (17 April 2014), I suggest to use Crosswalk 5 beta. It resolves two issues you mentioned:

  1. it has dedicated crosswalk-cordova-android build which contains xwalk_core_library;

  2. it support Eclipse well. The steps in wiki have been verified to work for current beta.

I don't recommend to use crosswalk 4 stable. It is known to have above issues. And since canary is usually under heavy devoloment, it is not stable enough for productions.

tashuhka
  • 5,028
  • 4
  • 45
  • 64
ningxin
  • 11
  • 1
  • Thanks for the update. I have a question if I may. As far as the plugins, what would be the plan of action to allow all of Cordova's plugins? I noticed there are quite of few but it would be lovely to be able to fit a few more that I used, such as Brightness and Plugin Version. Is there anything I could do to add them? – Martavis P. Apr 17 '14 at 19:26
  • I have one question - in the instructions after you import into Eclipse, you say: "Build the each project. Start from “xwalk_core_library”.. - however I can't build this project because it' a library. How can I build it into the application? I've already references it as part of the project - anyone know? – gregavola May 19 '14 at 03:09
0

The way that works best for me is first starting a bare bones Cordova using the Cordova-CLI

$ npm install -g cordova
$ cordova create hello com.example.hello HelloWorld
$ cd hello

Then follow this Crosswalk migration guide to add Crosswalk to the project we just created. https://crosswalk-project.org/documentation/cordova/migrate_an_application.html

Alternatively you could check out this other command line tool that does the migration for you. https://www.npmjs.com/package/cordova-android-crosswalk

$ npm install -g cordova-android-crosswalk
$ cordova-android-crosswalk

After this you should have a Cordova app that is bundled with Crosswalk. Just do the standard cordova run android and enjoy the performance boosting power of Crosswalk.

Tyler Buchea
  • 1,642
  • 3
  • 17
  • 25
0

If have the Cordova CLI, all you really need to do is:

  • create cordova project
  • add android platform
  • delete the contents of android/CordovaLib
  • download the crosswalk/android zip and copy files from the "framework" folder to CordovaLib
  • update library with: android update project --subprojects --path . --target "(TARGET_VERSION)" eg "android-19"
  • create debug apk with ant debug command
  • rebuild your platform
  • and use cordova run android to get it booted

This worked for me, but I wish I knew about the cordova-android-crosswalk npm package earlier!

4UmNinja
  • 510
  • 4
  • 14
0

I had lots of issues with removing/adding/removing crosswalk for different builds.

The simplest thing to do (which worked for me) was;

    cordova plugin remove cordova-plugin-crosswalk-webview
( take a copy of any android platform files you've altered )
    cordova platform remove android
    cordova platform add android
( reinstate android platform files you've altered )
    cordova plugin add cordova-plugin-crosswalk-webview

(just removing the crosswalk plugin leaves stuff around. Clear the android platform to start afresh)

EDIT: Looks like crosswalk adds permissions via its plugin.xml file so unless you want those in your project you need to manage that too when adding/removing. Specifically ;

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Bob
  • 1,589
  • 17
  • 25