简体   繁体   English

人行横道科尔多瓦不建

[英]Crosswalk Cordova does not build

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.我相信我从https://download.01.org/crosswalk/releases/crosswalk/android/下载的每个版本的 Crosswalk Cordova 都不能为我成功构建开箱即用。 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.我能够成功构建的唯一一次是当我阅读命令行上的每个错误并浏览必要的 java 文件来注释导致问题的某些代码时。 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.然而,由于我是 Crosswalk 的新手,我不太了解代码库以继续这样做,至少不可靠和仔细。

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.我的主要目标是构建 Crosswalk Cordova 示例项目,以便我可以用我已经创建的 Web 应用程序替换资产代码。 Has anyone had luck with this?有没有人有这方面的运气? Could anyone share a very stable build that builds successfully out the box?任何人都可以分享一个非常稳定的构建,可以成功地开箱即用吗?

Thanks谢谢

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您应该查看此处发布的 POC Joe Bowser: https : //github.com/infil00p/cordova-android/tree/pluggable_webview

note that it is contained in the pluggable_webview branch --edit--请注意,它包含在 pluggable_webview 分支中 --edit--

You install the crosswalk browser through PlugMan from this repo: https://github.com/infil00p/cordova-crosswalk-engine您可以从这个 repo 通过 PlugMan 安装人行横道浏览器: https : //github.com/infil00p/cordova-crosswalk-engine

note that the xwalk engine itself is not included in either repo.请注意,这两个存储库中都不包含 xwalk 引擎本身。 The plugin repo provides the hooks, the cordova fork provides the functionality to swap webviews.插件 repo 提供了钩子,cordova fork 提供了交换 webviews 的功能。

Joe is a core Cordova team member and created a crosswalk-cordova demo which does work (I've tested it myself). Joe 是 Cordova 团队的核心成员,并创建了一个有效的人行横道科尔多瓦演示(我自己测试过)。

Lorenzo洛伦佐

you can reference here ( https://crosswalk-project.org/#wiki/Add-Plugins-With-Crosswalk-Cordova-Android ) on how to add more plug-ins.您可以参考此处 ( https://crosswalk-project.org/#wiki/Add-Plugins-With-Crosswalk-Cordova-Android ) 如何添加更多插件。 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大多数插件应该可以正常工作,如果不能,请随时通过 JIRA 系统向我们报告问题: https : //crosswalk-project.org/jira/secure/Dashboard.jspa或通过 Crosswalk 社区支持例如人行横道邮件列表

Sorry for the confusion and thanks for trying to build Cordova App with Crosswalk.抱歉让您感到困惑,并感谢您尝试使用 Crosswalk 构建 Cordova 应用程序。

As today (17 April 2014), I suggest to use Crosswalk 5 beta .今天(2014 年 4 月 17 日),我建议使用Crosswalk 5 beta It resolves two issues you mentioned:它解决了您提到的两个问题:

  1. it has dedicated crosswalk-cordova-android build which contains xwalk_core_library ;它有专门的crosswalk -cordova-android版本,其中包含xwalk_core_library

  2. it support Eclipse well.它很好地支持Eclipse。 The steps in wiki have been verified to work for current beta. wiki 中的步骤已被验证适用于当前测试版。

I don't recommend to use crosswalk 4 stable.我不建议使用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最适合我的方法是首先使用 Cordova-CLI 启动一个裸骨 Cordova

$ 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.然后按照这个 Crosswalk 迁移指南将 Crosswalk 添加到我们刚刚创建的项目中。 https://crosswalk-project.org/documentation/cordova/migrate_an_application.html 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 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.在此之后,您应该拥有一个与 Crosswalk 捆绑在一起的 Cordova 应用程序。 Just do the standard cordova run android and enjoy the performance boosting power of Crosswalk.只需执行标准的cordova run android并享受Crosswalk的性能提升能力。

If have the Cordova CLI, all you really need to do is:如果有 Cordova CLI,您真正需要做的就是:

  • create cordova project创建科尔多瓦项目
  • add android platform添加安卓平台
  • delete the contents of android/CordovaLib删除android/CordovaLib的内容
  • download the crosswalk/android zip and copy files from the "framework" folder to CordovaLib下载人行横道/android zip 并将文件从“框架”文件夹复制到 CordovaLib
  • update library with: android update project --subprojects --path . --target "(TARGET_VERSION)"更新库: android update project --subprojects --path . --target "(TARGET_VERSION)" android update project --subprojects --path . --target "(TARGET_VERSION)" eg "android-19" android update project --subprojects --path . --target "(TARGET_VERSION)"例如 "android-19"
  • create debug apk with ant debug command使用ant debug命令创建调试 apk
  • rebuild your platform重建你的平台
  • and use cordova run android to get it booted并使用cordova run android启动它

This worked for me, but I wish I knew about the cordova-android-crosswalk npm package earlier!这对我有用,但我希望我早点知道 cordova-android-crosswalk npm 包!

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) (只是删除crosswalk插件会留下东西。清除android平台重新开始)

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.编辑:看起来 crosswalk 通过其 plugin.xml 文件添加了权限,因此除非您希望在项目中使用这些权限,否则在添加/删除时也需要对其进行管理。 Specifically ;具体来说 ;

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM