问题
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
回答1:
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
回答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
回答3:
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:
it has dedicated crosswalk-cordova-android build which contains xwalk_core_library;
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.
回答4:
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.
回答5:
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!
回答6:
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" />
来源:https://stackoverflow.com/questions/23069156/crosswalk-cordova-does-not-build