How to build android with Crosswalk lite using ionic-cli?

后端 未结 3 2090
旧时难觅i
旧时难觅i 2021-02-13 07:18

When I compile APK using Crosswalk (ionic browser add crosswalk; ionic build android), the size is too big (~20 MB). I think using crosswalk lite will reduce the si

相关标签:
3条回答
  • 2021-02-13 07:48

    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. 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. Good news is the team is working on rebasing lite to 14.0. Hopefully it comes out ASSP.

    0 讨论(0)
  • 2021-02-13 07:49

    Ionic-cli now has an option for lite:

    ionic browser list

    ionic browser add crosswalk-lite

    although, you may want to see this post

    0 讨论(0)
  • 2021-02-13 08:01

    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)

    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.

    2. Navigate to your npm node-modules folder : default in windows is

    C:\Users\@YOUR_USER_NAME\AppData\Roaming\npm\node_modules

    find the ionic module folder , and then , and start editing browser.js file , file can be found inside:

    node_modules\ionic\lib\ionic\browser.js

    1. In your code editor find the line #169 :

    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.

    We will be adding our lite version manually , so we can download it later.

    We will be changing some value temporarily for downloading lite version , but remmeber to turn it back to its original value later :

    in line#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';

    1. in line#39 there is an array of objects crosswalkVersions , add this object to it :

    {
      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 :

    ionic browser list
    

    and as you can see it got listed in available versions: available xwalk versions

    1. Final step is to download your crosswalk-lite project into your project folder via CLI Command :

      ionic browser add crosswalk@10.39.234.1

    That is all you are done.

    P.S:

    I have never tried ionic in building my hybrid projects.

    0 讨论(0)
提交回复
热议问题