Cordova CLI: Mismatch of CPU architecture

crosswalk project 64 bit apk
cordova arm64
cordova build arm64
cordova-plugin-crosswalk webview alternative
xwalkmultipleapk

I've been searching through CLI docs, SO questions, Cordova issues and more for quite some time, but I'm stumped.

So I've created a simple Cordova app for Android using Crosswalk (cordova create, cordova platform add android, cordova plugin add cordova-plugin-crosswalk-webview, cordova build android, nothing fancy). This, by default, generates a bunch of apk's on cordova build which is fine.

But then cordova run android --device installs the arm64 apk which crashes at startup on my device with the message Mismatch of CPU Architecture - with a button to the store to GET CROSSWALK - which is not what I want.

I'd like to instruct cordova run android --device to install and run the armv7 apk, which runs perfectly fine if installed manually via adb install. How can I do this?

  • cordova v8.0.0
  • cordova-android v7.0.0
  • cordova-plugin-crosswalk-webview v2.4.0

Notes:

  • this is for a debug build for local development, not for release.
  • using cordova-android@6.4.0 instead of 7.0.0 works fine, it installs the correct apk.

Thank you!

I've resolved this issue follow @Mtz recommendation:

1) Install https://github.com/MBuchalik/cordova-build-architecture plugin adding to config.xml like this

<plugin name="cordova-build-architecture" spec="https://github.com/MBuchalik/cordova-build-architecture.git#v1.0.4" source="git" />

2) Add this preference to android section in config.xml:

<preference default="arm" name="buildArchitecture" />

3)

cordova clean
cordova build (This step only generates one apk, armv7)
cordova run --devices

The run command will install only armv7 version, remember to remove all apk from your device before trying this

Cordova CLI: Mismatch of CPU architecture, But then cordova run android --device installs the arm64 apk which crashes at startup on my device with the message Mismatch of CPU Architecture - with a  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.

Crosswalk: "Mismatch of CPU architecture" popup after build , Cordova CLI: 6.5.0 Ionic Framework Version: 3.1.1 Ionic CLI Version: 2.2.3 Ionic App Lib Version: 2.2.1 Ionic App Scripts Version: 1.3.7  $ cordova -v 8.0.0 $ cordova create crosswalkTest $ cd crosswalkTest $ cordova plugin add cordova-plugin-crosswalk-webview $ cordova platform add android $ cordova platform list Installed platforms: android 7.0.0 Available platforms: browser ~5.0.1 ios ~4.5.4 osx ~4.0.1 windows ~5.0.0 www ^3.12.0 $ cordova run Thanks for any help

By default, Cordova generate a build.gradle file which changes according to your program behavior or plugins you installed.

In case you only need to install/run your apk for armv7 for debug purpose set the cdvBuildMultipleApks property to false.

check out this Setting Gradle Properties for cdvBuildMultipleApks property and allso, Build Environment UserGuide for setting it in the currect place.

this may allso be helpfull aswell: here

Mismatch of CPU Architecture · Issue #203 · crosswalk-project , Hello I've got this error while updating to cordova-android@7.0.0 (see the screenshot below) I was not sure if it was a plugin discrepancy  cordova - updated - mismatch of cpu architecture ionic Building combined armv7/x86 apk after Crosswalk integration in an Ionic project (3)

Cordova CLI: Mismatch of CPU architecture, android cordova cpu-architecture crosswalk cordova-cli. share|improve this question. edited Apr 2 at 11:26. asked Apr 2 at 10:36. Mtz. 5151122. Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Cordova CLI: Mismatch of CPU architecture. 1. include

How to solve Mismatch of CPU Architecture error in cordova , The crosswalk plugin generates by default a separate apk for each CPU architecture. Thing is, when deploying to an x86 device (like an  Force cordova to build for arm or x86. Useful on PhoneGap Build. - MBuchalik/cordova-build-architecture

Cordova CLI: Mismatch of CPU architecture, Cordova CLI: Mismatch of CPU architecture. Multi tool use. up vote 8 down vote favorite. I've been searching through CLI docs, SO questions,  Installing the Cordova CLI. The Cordova command-line tool is distributed as an npm package. To install the cordova command-line tool, follow these steps: Download and install Node.js. On installation you should be able to invoke node and npm on your command line. (Optional) Download and install a git client, if you don't already have one. Following installation, you should be able to invoke git on your command line. The CLI uses it to download assets when they are referenced using a url to a

Comments
  • follow this steps & generate the apk stackoverflow.com/a/26450074/4973660
  • I'm sorry @kirankumar, i wasn't clear enough. It's not a release build, but a debug build for local development. Also, those steps indicate an ant build, whereas the default builder (and which i'd like to use because it's the latest and recommended one) is gradle. Also i failed to specify that a similar build using cordova-android@6.4.0 works as intended. So i don't see how those steps would apply here, maybe i am missing something?
  • It's been a while, and since then i stuck with adb from a script for convenience (it can uninstall any existing .apk from the device). However, this is the closest answer for my question. Well done, sir.
  • Hi there! Unfortunately i am not using Android Studio, and - you didn't have any way of knowing this but - the last comment on that bug is mine, i'm Teodor Sandu, nice to meet you :) Back on topic, it's not solving the actual issue. Android Studio is not using cordova run internally, which is what i wanted to use (because it's a cli command, not a program i need to open manually, because it does uninstall, install and launch in one go, and because it's basically what should work out of the box with cordova cli). Thank you for your time though, i appreciate it!
  • You got a +1 vote from me for providing context and a working alternative, even though it's not what i was looking for - maybe for others it will suffice. Thanks again :)
  • Have you tryed with this ? https://github.com/MBuchalik/cordova-build-architecture Is a plugin to allow you to set desired architecture via config.xml. It patch default cordova gradle file.
  • I've seen that as well, thanks, but that plugin is involved in the build process, not in the installation :|
  • Thank you for trying, but that's not what i'm talking about. 1: it's not about the build, it's about cordova run not installing the correct apk for my device's architecture - it just chooses the wrong one, although the good one is built and works perfectly if i install it manually via adb install. 2: i do NOT want to set cdvBuildMultipleApks to false because the resulting apk is too large (and it doesn't quite make sense to me to ship 20Mb+ of code that will never be used). That said, thank you for your time! I appreciate it :)
  • you're welcome. i guess there is no magics regarding to deployment. i guess if you could just do it through CLI it will be perfect (like: cordova run android --device --arm7) but you can't . you'll need to interfered with the build itself. hope some one will give you another point of view on this issue :)