Crosswalk Cordova does not build

偶尔善良 提交于 2019-12-06 04:19:11

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

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

ningxin

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.

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.

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!

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" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!