Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Mismatch of CPU Architecture #203

Open
santi-cognifit opened this issue Feb 15, 2018 · 37 comments
Open

Mismatch of CPU Architecture #203

santi-cognifit opened this issue Feb 15, 2018 · 37 comments

Comments

@santi-cognifit
Copy link

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 problem, so I created a new project, but the result was the same:

$ 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

screenshot_2018-02-15-11-25-52

Thanks for any help

PD: I was thinking in removing this plugin, but we have a non-negligible amount of users with android 4.4.x. Is it safe to remove this plugin? Is there an alternative?

@telemakhos
Copy link

Same problem here... did you manage to solve it?

@lovelyelfpop
Copy link

lovelyelfpop commented Feb 27, 2018

Same problem here

@andaqui
Copy link

andaqui commented Feb 27, 2018

Same problem.

@ghost
Copy link

ghost commented Feb 27, 2018

Same problem. It happens on cordova-android@6.4.0 too

@voltor
Copy link

voltor commented Feb 28, 2018

I solved the problem.
I found that the plugin works correctly in my case.
The problem was with the Android Studio.
Android Studio 3.0.1 uses arm64Debug by default.
To solve this problem I have taken the following steps in the Android Studio:

  1. click on the app
  2. Build ->Select Build Variant
  3. Select armv7Debug

@andaqui
Copy link

andaqui commented Feb 28, 2018

The solution @voltor posted works for me aswell.

@voltor
Copy link

voltor commented Mar 1, 2018

This plugin really works incorrectly on the device with arm64 CPU architecture.
You can install armv7 APK file to your device but you will install arm64 APK from the Play Store when arm64 APK file is in the Play Store

@westcoastavgallery
Copy link

same issue here, works fine uploading just the non 64 arm like what @voltor said

@steodor
Copy link

steodor commented Apr 2, 2018

I'm having the same issue, cordova run android --device installs the wrong apk. I'd like to specify to cordova run that i want armv7 and not arm64 but i don't know how - any ideas?

Meanwhile, a workaround is to install the armv7 apk using adb directly like so (from project root folder):
adb install platforms/android/app/build/outputs/apk/armv7/debug/app-armv7-debug.apk

@JacobSchwartzSoerensen
Copy link

@voltor A solution to this is to only upload the armv7 and x86 apk's to playstore 😉

@osvaldoconcepcion
Copy link

As said above the issue is with arm64 CPU builds. When crosswalk is added to the project it generates by default multiple apks. Adding <preference name="xwalkMultipleApk" value="false" /> to your config.xml will generate a unique apk that combines armv7 and x86.

@WilsonFpz
Copy link

same issue here

@JavedChaudary
Copy link

@ikarus-balsero now my app size reaches to 108mb by following your method. How to reduce App Size?

@steodor
Copy link

steodor commented Sep 3, 2018

@JavedChaudary it's that large because it contains both armv7 and arm64 compiled versions of the same browser component, as the <preference name="xwalkMultipleApk" value="false" /> setting instructs the build process to do, so basically it works as expected but the apk size is a downside. You can remove the preference (or set it to true) to get separate, smaller apk files, then see my comment above for a workaround (if the path doesn't work as-is, just locate the correct apk you want and adb install it).

@JavedChaudary
Copy link

@steodor Thanks for the guidance

@voltor
Copy link

voltor commented Jan 17, 2019

reminder for android developers https://android-developers.googleblog.com/2019/01/get-your-apps-ready-for-64-bit.html

@YehudaK
Copy link

YehudaK commented Feb 25, 2019

adb install platforms/android/app/build/outputs/apk/armv7/debug/app-armv7-debug.apk
Thanks for a good solution. I created simple grunt instruction to build app and then install it on active device (since doing it manually every time I make changes, it's too time consuming).

@cikcoh
Copy link

cikcoh commented Mar 1, 2019

As said above the issue is with arm64 CPU builds. When crosswalk is added to the project it generates by default multiple apks. Adding <preference name="xwalkMultipleApk" value="false" /> to your config.xml will generate a unique apk that combines armv7 and x86.

HI, I already have working build that support kitkat & above in playstore.
But need to upload another to support jellybean users. So i duplicate the project, install cordova-android 6.4 and crosswalk.

Finally managed to build successfully. Followed your step, installed unique apk to emulator with jellybean api and app 'stopped working'.
So, i tried to install to my device with nougat api and get the 'mismatch cpu architecture' instead.

Help would be appreciated.

@SuperStar518
Copy link

After a long period of troubles, I've found my own solution.
It's simple but NOT effective - INSTALL crosswalk-project-64bit
https://apkpure.com/crosswalk-project-64bit/org.xwalk.core64

Would any star of this community update the current plugin in order to meet the need of 64bit support until August 1st?
Thanks in advance.

@Kiludude
Copy link

Kiludude commented Jun 7, 2019

  • Trying to build an arm64 version of my app but I can't get crosswalk to be included
  • arm7 works fine but every time I try to install arm64 version, I get the "mismatch of CPU architecture" popup
  • Only solution I have found is to manually install https://apkpure.com/crosswalk-project-64bit/org.xwalk.core64 on the device
  • But that is not an option for me.. is there a way to include crosswalk for arm64 builds?

@SuperStar518
Copy link

SuperStar518 commented Jun 7, 2019

@Kiludude You've faced the same situation with me.
At the moment, i feel that the only workaround is to install crosswalk-project-64bit. >_<

@skxu
Copy link

skxu commented Jul 16, 2019

@alidavid0418 @Kiludude
Have either of you two found a way to include crosswalk? Running into the same issue.

@alanst32
Copy link

@alidavid0418 @Kiludude @skxu I'm facing the same problem. I'd like to build arm64 version but I am getting the msg.. Any update on this issue?

@voltor
Copy link

voltor commented Jul 17, 2019

I use this way:

cordova build android --release --xwalk64bit
or
<preference name="xwalk64bit" value="true" />
+'org.xwalk:xwalk_core_library:23.53.589.4'
+ I removed 'productFlavors' in the cordova-plugin-crosswalk-webview\mobile-xwalk.gradle

it works for me

@alanst32
Copy link

Thanks @voltor for me worked when I changed the command to:

ionic cordova build android -- --xwalk64bit --release

@natiels
Copy link

natiels commented Jul 24, 2019

Thank you @voltor ! That worked for me. Just to add some details for future folks.

Modify the .gradle file found in your project's platforms/android/cordova-plugin-crosswalk-webview directory. Add the line flavorDimensions "versionCode" under the android section in order to avoid the build errors about product flavors.

I ended up adding a cordova hook in after_prepare to run a script and add the line using a sed command.

don't use this script verbatim, but it should give you a good start.

  XWALK_GRADLE_FILE=platforms/android/cordova-plugin-crosswalk-webview/myproject-xwalk.gradle
  if grep -q "flavorDimensions" ${XWALK_GRADLE_FILE}; then
    echo "   flavorDimensions already set in ${XWALK_GRADLE_FILE}"
  else
    echo "   Adding flavorDimensions in ${XWALK_GRADLE_FILE}"
    sed -i '/android {/a flavorDimensions "versionCode"' ${XWALK_GRADLE_FILE}
  fi

This script will find the "android {" entry and add the flavorDimensions line right after it.

@voltor
Copy link

voltor commented Jul 25, 2019

Thank you @natiels ! I did the same with the cordova hook. Thanks for knowledge for flavorDimensions

@SuperStar518
Copy link

Thank you, @voltor @natiels
I'll try your workarounds

@SuperStar518
Copy link

I think this issue should be closed now since there's a new issue regarding to 64 bit mis-architecture and a good solution as well.

It works quite well for me. Thanks, @lumitor2

@wiljeanlouis
Copy link

I think this issue should be closed now since there's a new issue regarding to 64 bit mis-architecture and a good solution as well.

It works quite well for me. Thanks, @lumitor2

Hello @alidavid0418
I am struggling with the problem to add both the 64bit and 32bit libraries in the same apk or android bunble.
Because:
1- if I try to upload an apk containing only the 64bits lib, Google Play Store says to me my apk will not compatible with some devices.
2- if I upload one with only the 32bits, Google Play Store gives error about not supporting 64bits devices. (After 08/01/2019, apks must support 32 and 64 bits devices.

Any help please.

@wiljeanlouis
Copy link

I think this issue should be closed now since there's a new issue regarding to 64 bit mis-architecture and a good solution as well.
It works quite well for me. Thanks, @lumitor2

Hello @alidavid0418
I am struggling with the problem to add both the 64bit and 32bit libraries in the same apk or android bunble.
Because:
1- if I try to upload an apk containing only the 64bits lib, Google Play Store says to me my apk will not compatible with some devices.
2- if I upload one with only the 32bits, Google Play Store gives error about not supporting 64bits devices. (After 08/01/2019, apks must support 32 and 64 bits devices.

Any help please.

My bad. Everything is ok now.
I just create an apk for each architecture (32bit and 64bit) and upload each of them on Google play store.
thanks

@pastinyala
Copy link

reminder for android developers https://android-developers.googleblog.com/2019/01/get-your-apps-ready-for-64-bit.html

@voltor how can i make a 64 bit app that compatible for all phone?

@pastinyala
Copy link

anyone can help me? :(

@pastinyala
Copy link

I think this issue should be closed now since there's a new issue regarding to 64 bit mis-architecture and a good solution as well.
It works quite well for me. Thanks, @lumitor2

Hello @alidavid0418
I am struggling with the problem to add both the 64bit and 32bit libraries in the same apk or android bunble.
Because:
1- if I try to upload an apk containing only the 64bits lib, Google Play Store says to me my apk will not compatible with some devices.
2- if I upload one with only the 32bits, Google Play Store gives error about not supporting 64bits devices. (After 08/01/2019, apks must support 32 and 64 bits devices.
Any help please.

My bad. Everything is ok now.
I just create an apk for each architecture (32bit and 64bit) and upload each of them on Google play store.
thanks

@Jilouwikyky may i know what do you mean when u say upload each of them on google play store? did u upload 2 apk on 1 app account? is it smthg like that?

@wiljeanlouis
Copy link

@Jilouwikyky may i know what do you mean when u say upload each of them on google play store? did u upload 2 apk on 1 app account? is it smthg like that?

@pastinyala Yes I did.
I upload 4 apks. See the picture for more information.
Screenshot from 2020-01-21 09-45-13

@matrixreal
Copy link

@Jilouwikyky may i know what do you mean when u say upload each of them on google play store? did u upload 2 apk on 1 app account? is it smthg like that?

@pastinyala Yes I did.
I upload 4 apks. See the picture for more information.
Screenshot from 2020-01-21 09-45-13

Hello,
i'm stuking with this problem since 3 days
can you tell us what are the names of apks that you did upload?
thanks

@pastinyala
Copy link

@Jilouwikyky may i know what do you mean when u say upload each of them on google play store? did u upload 2 apk on 1 app account? is it smthg like that?

@pastinyala Yes I did.
I upload 4 apks. See the picture for more information.
Screenshot from 2020-01-21 09-45-13

does it mean, when u upload 4 apk, all the 4 apk will appear in play store based on the users' phone specs? but wasn't play store will reject the apk that have same version number? or all the 4 apk you upload have a different version number?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests