Closed JuanLHDarien closed 4 years ago
You only need a 64bit apk if you include native libaries in your app.
If you do, then you must use a multi apk setup. This is not very common, so the documentation is kind of lacking unfortunately, but some information can be found at https://cordova.apache.org/docs/en/latest/guide/platforms/android/index.html#setting-gradle-properties
Cordova will generate an APK for each ABI. You have to upload each APK variant to the Google Play store when you make your releases.
Alternatively, you can try the bundle format, but this only works if plugins supply a native so file for each ABI. So it depends on how the plugin has their native dependencies configured.
If you're using the latest version of cordova-android (version 8.1.0 at the time of writing), then you can build bundles by passing the --packageType=bundle
flag e.g.:
cordova build android --release -- --packageType=bundle
Do note, bundles are only supported for release builds. This will build an .aab
file, which you can also upload to the google play store.
Hi @breautek I have tried the second option you already stated , still the error persists for some reason unknown. What I did try was to upload all apk variants of the app. And still got the 64bit not compliant issue. The first one the X86_64 variant gave the bits error and the other 4 gave me the "fully shadowed apk" .
I really have tried everything and anything I have read online and read on the docs without any definitive answer on what is going on
Edit: Tried instead of simultaneously uploading all variants, uploading one by one , all gave the error of 64bit compliant , how is this possible?
Your APKs don't appear to be targeting to any native platforms. They look like they are being built as universal APKs, which does not work native libraries.
The first APK states it's not compliant because it likely has native code bundled in it, and so you need a 32bit and a 64bit variant. The other remaining APKs are "shadow apks" because they have no difference to the first APK, therefore it will never ever be installed.
It's also possible that the third-party plugin that is including a native library is not even providing a 64bit version of the native library, in which case you'll need to contact the maintainer of that library/plugin.
I'm not sure how to do this in ionic, but if the bundles didn't work, you can try going the out-school route, which is the multiple apk setup. The cordova command to enable multiple apks is:
cordova build android -- --gradleArg=-PcdvBuildMultipleApks=true
Inside platforms/android/app/build/outputs/apk
, you'll see several directories, an APK for each native platform.
@breautek Yeah the thing is there's not native code because when I analyze the apk there's no libs\ folder , and no .so files, so no native code at all , anyways will try with your option and come back to you if it fails.
edit the only .so file found inside the project is the libnative.so in the org.test.plugins.dummyplugin
Yeah the thing is there's not native code because when I analyze the apk there's no libs\ folder , and no .so files, so no native code at all , anyways will try with your option and come back to you if it fails.
Google Play appears to believe there is. Is your android sdk installation are all up to date? I' found this which suggest you may see 64bit compliance issues if you're using an old enough version of build tools.
It did indeed fail once again @breautek I really don't understand what is going on , the thing is that the iOS version has no problem at all producing 64bit compliant code but the android one is, I have all my version build tools updated. I don't know what else to try
I'm happy to notify you @breautek that the problem was that the previous incompatible 32bit release of the app, once deactivated (hadn't done that all) immediately stopped showing the 64bit compliant error. It's all fixed , sorry for the inconveniance
Ah, I don't recall ever having to do that, but at least you found the solution!
Bug Report
Problem
Ionic 4 app when compiled for deploy in Playstore is not 64bit compliant, this only happens with the android version on the app using cordova , the iOS version is 64bit compliant for the respective platform.
What is expected to happen?
The compilation of a 64bit universal apk.
What does actually happen?
A 32bit universal apk.
Information
Command or Code
npx ionic cordova build android --prod --release
jarsigner
for signing apkzipalign
for compressing assets in apkEnvironment, Platform, Device
Windows 10 Pro Android 7 Phone (tested positive for app functionality and install) Android 9 Phone (tested positive for app functionality and install) Android 10 Phone (tested positive for app functionality and install) Playstore (Current problem)
Version information
Checklist