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

@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 https://github.com/Igor1201/meteor 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?

Did you export the directories on PATH and ANDROID_HOME on tour build script? android-19 doesn’t need to be removed on every build, just a single time. And I’ve used built-in android utility to update/remove Android SDK and build-tools I won’t use.

@woniesong have you achieved your goal yet?

Guys look:

Crosswalk is becoming an official package!

4 Likes

@borges and @arjunrajjain I build an initial version of my app using ionic and uploaded it into play store. I have the key pem file with me. I have now revamped the entire app using Meteor.

How can I build an update for the initial app to replace it on the play store. Is it the same procedure or different? Could you please give us the steps for uploading apk updates to existing projects in Google Store?

Thanks for the effort,Guys!

@gutsyninja You don’t need to update on Play Store at all, as Meteor would update itself via hot-code push. But if you want your app to keep up-to-dated to your server (eg. without update via Meteor), you can publish on Play Store the exactly same way.

Not only crosswalk, but as every modification to make it work out of the box as well. Way to go @martijnwalraven!

@borges Hey Igor! Earlier I wasn’t aware of the awesomeness that is Meteor and built my app using ionic+node. I’ve changed my entire stack to meteor now but wanted to retain my previous playstore listing rather than upload it as a new app.

@borges Hi Igor. I followed your steps and got a problem at step 7 adding crosswalk. This is a part of the output:

error: Conflict: Constraint meteor@1.1.7-rc.1 is not satisfied by meteor 1.1.6.
Constraints on package "meteor":
* meteor@=1.1.6 <- top level
* meteor@1.1.5 <- meteor-platform 1.2.2
* meteor@1.1.5 <- underscore 1.0.3 <- aldeed:collection2 2.5.0
* meteor@1.1.5 <- reload 1.1.3 <- autoupdate 1.2.1 <- meteor-platform 1.2.2
* meteor@1.1.5 <- reload 1.1.3 <- meteor-platform 1.2.2

I used your branch, so I guess the files are already patched. Do you have any advice on how to proceed?
Thanks in advance

@joke Probably one of your packages has a Meteor version restraint on 1.1.7-rc.1, which causes a version conflict because of the -rc.1 part.

I’m actually looking forward to upgrade my projects to the latest and official Meteor 1.2 RC, and there’s a nice guide here if you want to do the same.

@borges Hi Igor. Thanks already for the answer. I tried to add crosswalk now to a new project created with the meteor version from your branch via

~/meteor-devel/meteor create test

where meteor-devel is just a clone of your branch. I still get the same error error.

error: Conflict: Constraint meteor@1.1.7-rc.1 is not satisfied by meteor 1.1.6.
Constraints on package "meteor":
* meteor@=1.1.6 <- top level
* meteor@1.1.7-rc.1 <- crosswalk 1.2.0-rc.0

So as I understand, the version constraints exist already in the base meteor package. I’m still quite new to meteor, so I’m not sure on how to proceed. I have already another official meteor installation and just cloned your meteor branch into my home folder. May that cause the problem?

Ok, finally I got it working. For others who encounter similar problems:

  • Clone the release-1.2 branch from meteors github page.
  • Run ./meteor in the downloaded meteor folder to load all dependencies like described here at Slow Start (for developers).
  • Go to your project folder and run /path/to/release-1.2/meteor update as Igor described above
  • Add crosswalk simply with /path/to/release-1.2/meteor add crosswalk

No problems occured for me. Thanks again for your help.

@joke Nice! That’s what I said I’d do on my existing projects, but update an already working project to a new meteor version like that one is not easy as starting a new project on that same version!

I’ll remove my branch and recommend the new meteor version, as it already has crosswalk support built-in!

Simply updating to 1.2 rc 15 and adding the crosswalk package works fine for me.

1 Like

Well, 1.2 is finally out :slight_smile:

2 Likes

I have a question about the crosswalk package:
I added the package to my project, and I run the build command, but all I can see inside the <build folder>\android is the usual release-unsigned.apk (and even when I go further into <build folder>\android\project\build\outputs\apk I only find the usual apk files, no one of them have the crosswalk plugin in it.

What should I do to get the crosswalk apk?

I was just going to ask the same. Crosswalk package has been added, but no crosswalk builds can be found anywhere in the build folder. Could this have something to do with migration to Meteor 1.3?