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

16.08.20191 Min Read — In cordova

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>