[英]How to build android with Crosswalk lite using ionic-cli?
When I compile APK using Crosswalk ( ionic browser add crosswalk; ionic build android
), the size is too big (~20 MB). 当我使用Crosswalk(
ionic browser add crosswalk; ionic build android
)编译APK时,大小太大(~20 MB)。 I think using crosswalk lite will reduce the size of compiled APK. 我认为使用crosswalk lite会减少编译APK的大小。 But I have no idea to hack ionic-cli to use crosswalk lite.
但是我不知道使用ionic-cli来使用crosswalk lite。
My question is: 1. Will this support crosswalk lite? 我的问题是:1。这会支持人行横道吗? 2. Is there any hack (or temporary solution) to use crosswalk lite?
2.是否有任何黑客(或临时解决方案)使用人行横道精简版?
Thanks. 谢谢。
This is experimentary , but it will work , cant guarantee there will be no bugs when you build your app though , please read this well before you proceed. 这是实验性的,但它会起作用,但不能保证在构建应用程序时不会有任何错误,请在继续之前阅读此内容 。
Procedure : ( all steps are done from a machine running MS-Windows 8.1) 步骤:(所有步骤均由运行MS-Windows 8.1的计算机完成)
First of all, I have searched for available crosswalk-lite everywhere to download the version from , it appears that there are only 3 available versions to download found here , and as you can see the latest is 10.39.234.1
i tried later versions like 12.xx , 13.xx , and 14.xx but in vain , could not find any repo for later versions. 首先,我已经寻找可用的人行横道,精简版处处从下载的版本,似乎有只下载找到3个可用的版本在这里 ,并且你可以看到最新的是
10.39.234.1
我想以后的版本就像是12 .xx,13.xx和14.xx但是徒劳无功,找不到任何后续版本的仓库。
Navigate to your npm node-modules folder : default in windows is 导航到您的npm node-modules文件夹:Windows中的默认值
C:\\Users\\@YOUR_USER_NAME\\AppData\\Roaming\\npm\\node_modules
C:\\ Users \\用户@YOUR_USER_NAME \\应用程序数据\\漫游\\故宫\\ node_modules
find the ionic module folder , and then , and start editing browser.js file , file can be found inside: 找到离子模块文件夹,然后,开始编辑browser.js文件,里面可以找到文件:
node_modules\\ionic\\lib\\ionic\\browser.js
node_modules \\离子\\ lib中\\离子\\ browser.js
IonicTask.prototype.downloadCrosswalkWebview = function downloadCrosswalkWebview(architecture, version, releaseStatus) { ..... }
this function is responsible for downloading the crosswalk version you want , and it takes the following parameters : 此功能负责下载所需的人行横道版本,并采用以下参数:
architecture , version and releaseStatus.
架构,版本和releaseStatus。
We will be adding our lite version manually , so we can download it later. 我们将手动添加我们的Lite版本,以便稍后下载。
We will be changing some value temporarily for downloading lite version , but remmeber to turn it back to its original value later : 我们将暂时更改某些值以下载lite版本,但是remmeber稍后会将其恢复为原始值:
in line#178 : 在第178行:
change 更改
var downloadUrl = 'https://download.01.org/crosswalk/releases/crosswalk/android/' + releaseStatus + '/' + version + '/' + architecture + '/crosswalk-webview-' + version + '-' + architecture + '.zip';
to be : 成为 :
var downloadUrl = 'https://download.01.org/crosswalk/releases/crosswalk-lite/android/' + releaseStatus + '/' + version + '/' + architecture + '/crosswalk-webview-' + version + '-' + architecture + '.zip';
crosswalkVersions
, add this object to it : crosswalkVersions
,将此对象添加到它: { version: '10.39.234.1', publish_date: '2015-03-06 03:06', canary: true }
You can test that object is added successfully running this command in your CLI : 您可以在CLI中测试是否已成功添加运行此命令的对象:
ionic browser list
and as you can see it got listed in available versions: 正如您所看到的,它已列在可用版本中:
ionic browser add crosswalk@10.39.234.1
That is all you are done. 这就是你所做的一切。
PS: PS:
I have never tried ionic in building my hybrid projects. 我从来没有试过离子来建立我的混合项目。
Forget about Ionic-cli crosswalk-lite, it relies on cordova-plugin-crosswalk-webview, but cordova-plugin-crosswalk-webview does not support crosswalk-lite for now. 忘掉Ionic-cli crosswalk-lite,它依赖于cordova-plugin-crosswalk-webview,但是cordova-plugin-crosswalk-webview目前还不支持crosswalk-lite。 If you wanna use crosswalk-lite, you will have to use cordova-android 3.0 way with CordovaLib provided with crosswalk-lite-cordova ( https://download.01.org/crosswalk/releases/crosswalk-lite/android/canary/10.39.237.1/arm/crosswalk-cordova-10.39.237.1-arm.zip ), because latest crosswalk-lite is 10.0.
如果你想使用crosswalk-lite,你将不得不使用cordova-android 3.0方式与CordovaLib一起提供crosswalk-lite-cordova( https://download.01.org/crosswalk/releases/crosswalk-lite/android/canary/ 10.39.237.1/arm/crosswalk-cordova-10.39.237.1-arm.zip ),因为最新的crosswalk -lite是10.0。 Good news is the team is working on rebasing lite to 14.0.
好消息是团队正在努力将轻量级精简到14.0。 Hopefully it comes out ASSP.
希望它出来ASSP。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.