Crosswalk Integration Beta in Ionic CLI (v1.3.2)

I have the same question. Anyone can help?

image

image

When the folders “engine”、“plugins\org.apache.cordova.engine.crosswalk" have been deleted ,it works fine.

I want to stick to cordova 3.5 or 3.6.3 and crosswalk 10 release. Currently i’m doing that manually using steps given on crosswalk website for migrating cordova project to crosswalk.

I used these commands to prepare android build but it android platform is upgraded to cordova 4.x and crosswalk being used is 8.x. I want to use crosswalk 10.x build. is it possible?

Same issue.

:processDebugManifest
    /Users/applesw2/Documents/eDocMobile/master/platforms/android/AndroidManifest.xml:15:13 Error:
        Missing one of the key attributes 'action#name,category#name' on element intent-filter at AndroidManifest.xml:15:13
/Users/applesw2/Documents/eDocMobile/master/platforms/android/AndroidManifest.xml:0:0 Error:
        Validation failed, exiting

Great! For me it went smooth as silk.

Note that I did not have any version of crosswalk configured before I used the ionic command to do this.

I tested my application on android 4.0, 4.2, 4.3 and 4.4. They all worked more or less identical (appart from some differences on input forms).

Only two issues I see are:

  • no more splashscreen
  • the big size of the installed application

As I read in the comments, there will be two seperate builds for ARM and x86, but does this also mean the size of the installed application will be smaller or does it only affect the size of the APK?

If it will not affect the size of the installed application, then I would suggest to include a third APK build which does not include the crosswalk browser for devices with at least a given API level. For me, the reason to include crosswalk is to make the application work as expected on pre 4.4 devices as the webview in 4.4 is pretty complete, but before this, there are a lot of differences which, most of them, can be fixed by using crosswalk.

Anyways - Great job on the integration!

Kind regards
Ben

This looks interesting. Does anyone know if there are noticeable improvements when dealing with large SVGs inside of Crosswalk? The performance we’re seeing in the default android webview is quite bad - in regards to scalling, pinch/zoom (using hammerjs), etc.

Wondering if it this is worth a shot.

@Bennit

The splash screen is because of a change in Cordova-Android 4.0. This is a known issue, and requires the splash screen plugin to be updated. In the works on the cordova side of things.

As for the size of the app, once we can split the builds, we will see a significant drop is file size, since we aren’t bundling both run times.

As for not including crosswalk for Android 4.4+, this will require some research. As it is possible to specify multiple builds with gradle, we would just need to look into the logistics for not including crosswalk.

1 Like

@mhartington Not including Crosswalk for >=5.0 would be awesome. On Lollipop there is really no benefit, because the WebView is evergreen. And even with splitting out the x86 and armv7 binaries, Crosswalk adds about 20MB per APK.

If you’d like some pointers as to how to build the 3 separate APKs (pre-lollipop-x86, pre-lollipop-armv7, and post-lollipop), I have a sample Gradle project here that does exactly this. The only tricky part is:

  1. conditional dependencies for pre-lollipop (these lines).

  2. different version codes for the three versions (these lines). For x86 vs armv7 it doesn’t matter, but for post-lollipop, the build number needs to be higher, because you cannot set a “maxSdk” in Android (or rather, it’s deprecated), so the Play Store needs to use the higher version number in order to give the non-Crosswalk version to post-Lollipop devices.

Hope this helps!

6 Likes

command : ionic run android
finally i am facing this error help me

@mhartington this is really cool!. I am willing to work as tester.
Excited!

try to uninstall the app from the android emulator first then try again.

I’m providing Chromecast functionality in my app using this Cordova plugin

Which is dependant on the appcompat, mediarouter and googleplayservices libraries.

After I added Crosswalk using the CLI I now get the following error when trying to build the app

:libs:MediarouterLib:processDebugResources
/path/to/project/platforms/android/libs/MediarouterLib/build/intermediates/res/debug/values/values.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Light.ActionButton'. /path/to/project/platforms/android/libs/MediarouterLib/build/intermediates/res/debug/values/values.xml:44: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ActionButton'.

 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':libs:MediarouterLib:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
  	/Users/gharper/Development/android/sdk/build-tools/21.1.2/aapt package -f --no-crunch -I /Users/gharper/Development/android/sdk/platforms/android-21/android.jar -M /path/to/project/platforms/android/libs/MediarouterLib/build/intermediates/bundles/debug/AndroidManifest.xml -S /path/to/project/platforms/android/libs/MediarouterLib/build/intermediates/res/debug -A /path/to/project/platforms/android/libs/MediarouterLib/build/intermediates/bundles/debug/assets -m -J /path/to/project/platforms/android/libs/MediarouterLib/build/generated/source/r/debug --debug-mode --custom-package android.support.v7.mediarouter --non-constant-id -0 apk --output-text-symbols /path/to/project/platforms/android/libs/MediarouterLib/build/intermediates/bundles/debug
  Error Code:
  	1
  Output:
  	/path/to/project/platforms/android/libs/MediarouterLib/build/intermediates/res/debug/values/values.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Light.ActionButton'.
  	
  	/path/to/project/platforms/android/libs/MediarouterLib/build/intermediates/res/debug/values/values.xml:44: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ActionButton'.
  	


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.325 secs

/path/to/project/platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: /path/to/project/platforms/android/gradlew with args: assembleDebug,-b,/path/to/project/platforms/android/build.gradle,-Dorg.gradle.daemon=true
Error: /path/to/project/platforms/android/cordova/build: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:753:16)
    at Process.ChildProcess._handle.onexit (child_process.js:820:5)

Before installing the plugin I did have to edit project.properties and change target=android-19 to target=android-21 to avoid a similar error. I’m not sure what to do now as the project has been converted to Gradle which I’m inexperienced with.

Any assistance would be much appreciated.

Great work!
All went smoothly for me. I find it is integrated with Cordova 4.0 + Crosswalk 8.
I want to upgrade Crosswalk to 11+ in my project, but I cannot find the right way, could anyone help?
Would be very appreciate!

This feature will be added in a newer release we are working on.

Is it true that not all Cordova plugins are supported by the Crosswalk engine?
I found this list of compatible pugins but it seems already out of date: https://github.com/crosswalk-project/crosswalk-website/wiki/Crosswalk-Cordova-for-Android:-plugin-compatibility-lists

In my application at least the org.apache.cordova.statusbar plugin is not working.

/Alex

@grahamharper This may be an issue with the plugin itself, as the cordova-android version we are using for crosswalk is a unreleased version.

@Alex Same thing as above. Since we are using Cordova-Android 4.0, which isn’t released yet, not every plugin is guaranteed to work. When the cordova team release 4.0 officially, then the core plugins will be updated.

@grahamharper - I’m not sure what spurs that error.

Does your project.properties file still have the references for those added projects?

Yea it does. It looks like they were added to the list of dependencies in build.gradle too.

Looks awesome.
Few problem though :

  • Back button does not close modal
  • SocialSharing plugin does not work
  • Icon and splashscreen are gone ( I already had crosswalk so this might be a conf thing)
  • Getting error “0 333147 error Uncaught Error: Error calling method on NPObject., http://192.168.0.14:8100/cordova.js, Line: 924” but that does not stop the app ( might be useful though )
  • CLI does not detect that crosswalk is already installed ( you can run add crosswalk many time it’ll re download ). Very minor issue I know :slight_smile:

How can we check if crosswalk is installed ( and see version )

@nicraboy - sorry for the late response.

If you set an ENV setting or pass a setting in-line, it will produce two, yes.

BUILD_MULTIPLE_APKS=true