How to solve Mismatch of CPU Architecture error in cordova crosswalk plugin

August 16, 2019

The problem

There’s a misleading error message when using the crosswalk plugin with modern cordova builds:

error

Lucky for us, it doesn’t really mean every user has to download crosswalk separately for your app to work.

Why is this happening?

The crosswalk plugin generates by default a separate apk for each CPU architecture. Thing is, when deploying to an x86 device (like an emulator) it doesn’t choose the correct APK and we’re getting a mismatch at runtime.

The solution

The solution is quite simple, just add <preference name="xwalkMultipleApk" value="false" /> to config.xml, (you can put it under <platform name="android"> if you want to be tidy).

This tells crosswalk to generate one APK for both ARMv7 and x86.

<platform name="android">
  ...
  <preference name="xwalkMultipleApk" value="false" />
</platform>

Written by@Jonathan Perry
Fullstack dev - I like making products fast

GitHubMediumTwitter