How to get Crosswalk working with Android - Step by step guide

@borges - this is awesome! Glad to finally see Meteor embedding Crosswalk into its Android build. Have you seen any issues with plugins like facebookConnect?

@borges thanks heaps :slight_smile: going to have to give this a go soon. Much appreciated.

@borges thanks again.

I got the following errors on step 6:

=> Errors while upgrading packages:           
While selecting package versions:
error: No version of fastclick satisfies all constraints: @=1.0.6, @=1.0.3
No version of webapp satisfies all constraints: @=1.2.1, @=1.2.0
No version of autoupdate satisfies all constraints: @=1.2.2, @=1.2.1
No version of coffeescript satisfies all constraints: @=1.0.7, @=1.0.6
No version of ddp satisfies all constraints: @=1.2.0, @=1.1.0
No version of launch-screen satisfies all constraints: @=1.0.3, @=1.0.2
No version of logging satisfies all constraints: @=1.0.8, @=1.0.7
No version of mobile-status-bar satisfies all constraints: @=1.0.4, @=1.0.3
No version of oauth satisfies all constraints: @=1.1.5, @=1.1.4

Just trying to push ahead regardless, not sure of they are critical?

mmm… getting errors… so I assume could have to do with the above package version issue???

I was getting some errors when trying to deploy to an actual Android device via USB cable. So, I tried to run with run android to get it running on the emulator, I get, the following error:

% Uninstalling a plugin com.meteor.cordova-update
Using (built-in) Android SDK at /Users/adamginsburg/Documents/Development/meteor/android_bundle/android-sdk
% Running synchronously:  /Users/adamginsburg/Documents/Development/meteor/tools/cordova-scripts/ [ 'plugin', 'rm', 'com.meteor.cordova-update' ]
% Removing plugin from the tarball plugins lock com.meteor.cordova-update
% Will check for cordova-tarball-plugins.json for tarball-url-based plugins previously installed.
% The tarball plugins lock: { 'com.meteor.cordova-update': '' }
% Will write cordova-tarball-plugins.json     
% Uninstalling a plugin cordova-plugin-file   
Using (built-in) Android SDK at /Users/adamginsburg/Documents/Development/meteor/android_bundle/android-sdk
% Running synchronously:  /Users/adamginsburg/Documents/Development/meteor/tools/cordova-scripts/ [ 'plugin', 'rm', 'cordova-plugin-file' ]
% Getting installed plugins for project in /Users/adamginsburg/Documents/Development/buzzy7/.meteor/local/cordova-build
Using (built-in) Android SDK at /Users/adamginsburg/Documents/Development/meteor/android_bundle/android-sdk
% Running synchronously:  /Users/adamginsburg/Documents/Development/meteor/tools/cordova-scripts/ [ 'plugin', 'list' ]
% The output of `cordova plugins list`: No plugins added. Use `cordova plugin add <plugin>`.

% Will check for cordova-tarball-plugins.json for tarball-url-based plugins previously installed.
% The tarball plugins lock: {}                
Error while running for mobile platforms: ENOTEMPTY, rmdir '/Users/adamginsburg/Documents/Development/buzzy7/.meteor/local/cordova-build/platforms/ios/CordovaLib/CordovaLib.xcodeproj'
Error: ENOTEMPTY, rmdir '/Users/adamginsburg/Documents/Development/buzzy7/.meteor/local/cordova-build/platforms/ios/CordovaLib/CordovaLib.xcodeproj'
  at Object.Future.wait (/Users/adamginsburg/Documents/Development/meteor/dev_bundle/lib/node_modules/fibers/future.js:398:15)
  at Object.rm_recursive (/Users/adamginsburg/Documents/Development/meteor/tools/files.js:255:9)

Any ideas where I have gone wrong, pls?

Yeah, my bad, that’s the path to the Meteor executable.

@adamgins Well, the first error about the package versions is the reason I’ve created the first patch, take a look and change it to the right versions; besides, try not to force a specific version in your project.

And to the second set of errors, what I normally do is to rm -rf the build and .meteor/local folders, even if it slows down the compilation time.

Thanks A LOT @borges for your patches, it fixed my building problem. You rock.

Nice to hear that!
Now I’m trying to maintain a Meteor branch with a updated version since a couple of commits ago (with less modifications) broke my compilation.

1 Like

Yeah, I’m looking forward to @martijnwalraven’s work on Cordova Improvements. Hopefully we’ll see them by 1.2. Also looking into rocket:module to better serve assets to mobile.

It looks like my apps are constantly crashing using the devel branch and these patches on devices that are < Android 5.0 (< API 22…).
I blamed the hot code push at first, but after disconnecting my app from the mobile server, it crashes whenever I try to store data (with the sqlite plugin).

Are you experiencing the same issue ? Maybe someone found a workarround for APIs < 22 ?

EDIT : Okay, so I updated autoupdate’s dependencies of file and file-transfer plugin to their latest version (2.1.0 and 1.2.1). It seems to be working with API 19 now.

That’s what I’ve done too in my patches, @MaximeB. So far, it didn’t break anything.
Another thing that caught me with my pants down is that on some Android devices, sporadically, the app will crash on any undefined-like reactivity error. After that, I’ve been more cautious with that kind of situation.

Can any of you share your experience using crosswalk? I would like to see the advantages of using it! In which way does it improve the App?

@poliuk It’s much faster. I’ve integrated it with a large mobile app I’m currently writing and the difference is night and day. Scrolling long lists of items is smooth on crosswalk, and clunky on the regular webview, same with any and all css transitions, and any kind of interaction really. If you want to know what crosswalk is like vs the regular chrome webview, launch your application on ios, and android and compare. iOS will be leaps and bounds faster than android. Crosswalk is even better than iOS. (I have a Samsung galaxy s6 edge and compared it to a 4s, to give you an example of how bad it is).

Unfortunately, crosswalk is also huge. But, for the performance, I wouldn’t look anywhere else.


Can I still use Meteor’s hot code push feature when using crosswalk?

I was following your way, but in the end I got Current working directory is not a Cordova-based project error. Do you know about this?

Error: Error running /meteor-devel-path/tools/cordova-scripts/
Current working directory is not a Cordova-based project.

The latest devel branch has an issue that refers to the above error. I cloned borges’ meteor repo and used that instead. Everything ran correctly. However, in the end it failed to compile with the following error:

You may not have the required environment or OS to build this project

After a quick search I found out this error can happen if you don’t have android-sdk 21.0.0 version. So I checked my path to see if I added the most recent android-sdk correctly.

I did. /meteor-dev/android_bundle/android-sdk/build-tools/21.0.0

Blocked at this point…

@poliuk In addition of what @pmwisdom said, crosswalk is great to level the differences between android versions and devices (that’s the nicest iOS “feature”). Withou crosswalk, even the simplest production meteor app won’t work out on a lot of Android devices.

@timw Yeah, absolutely! Nothing changes.

1 Like

@woniesong Yeah, I’ve tried a couple of times to merge with the latest branch but couldn’t achieve it yet.

And actually, crosswalk uses android-22 (and build-tools 21.0.0). I have a separate Android SDK directory just for compile my projects with crosswalk, with only the android-22 target on android list target.

My build script exports this path momentarily:

export ANDROID_HOME=/Users/igor/meteor/android_bundle/android-sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_HOME/build-tools/21.0.0

Thanks… I also noticed the version of build tools was different. How did you get the build tools 22.0v? So once you replace the build tools, should everything work? My path actually looks like yours too.

Actually, I just use an old build-tools version. Never tested with the newest (22.0.1).

I cloned your Meteor repo at and followed the steps. This time I removed android-19 target and made sure I only had android-22 target (removed android-19 from system-images and platforms). $meteor-devel/android-sdk/tools/android list targets only returns android-22. I still get the error:

Command finished with error code 8: .meteor/local/cordova-build/platforms/android/cordova/build 
ERROR building one of the platforms: Error: .meteor/local/cordova-build/platforms/android/cordova/build: Command failed with exit code 8
You may not have the required environment or OS to build this project

I assume I might have not deleted the old android target somewhere. Is there a better way to remove the old target? Or did I miss some step?