Google Play 64-bit requirement

I am trying to upload my app on Google Play.
After uploading my APK on “Review and release” page I have the error message:

This release is not compliant with the Google Play 64-bit requirement.
The following APKs or App Bundles are available to 64-bit devices, but they only have 32-bit native code: [1]
Include 64-bit and 32-bit native code in your app. Use the Android App Bundle publishing format to automatically ensure that each device architecture receives only the native code it needs. This avoids increasing the overall size of your app.
The help link goes to
https://developer.android.com/distribute/best-practices/develop/64-bit

I am on 64 bit Windows. I used portable_game_skeleton as an example.

My APK’s ABIs: armeabi-v7a

So it is 32bit or 64bit version of APK?
Should I include both 32bit and 64bit versions into one APK file?
To build my project I use the command:
castle-engine package --os=android --cpu=arm

As far as I understood:
Yes, inside one APK I should have both 32 and 64 libs.

For the ARM architecture, the 32-bit libraries are located in armeabi-v7a . The 64-bit equivalent is arm64-v8a .

If you do not have any arm64-v8a or x86_64 libraries, you’ll need to update your build process to start building and packaging those artifacts in your APK.

So the question is how to configure build-tool to include both 32 and 64 libs and app files into one APK?

Exactly as you wrote, armeabi-v7a is 32-bit. The castle-engine package --os=android --cpu=arm means you only make 32-bit version (indicated by --cpu=arm).

The 64-bit Android CPU can be indicated by --cpu=aarch64 (there are historical reasons, beyond CGE and FPC, why it is not called just arm64 as one would expect :slight_smile: ).

You should put both 32-bit and 64-bit architectures in one application. To do this, just use castle-engine package --target=android.

This is documented on Android · castle-engine/castle-engine Wiki · GitHub , Docker · castle-engine/castle-engine Wiki · GitHub , fpcupdeluxe · castle-engine/castle-engine Wiki · GitHub :slight_smile: Everywhere we advise castle-engine package --target=android now (if we have some old manual/README that talks about --cpu=arm and then point me to it, I’ll want to update it).

Oh, note that it will only include 64-bit version if you have FPC >= 3.2.0, as earlier versions do not support Android on Arm64. In case of older FPC build tool shows a warning

FPC version .... does not support compiling for 64-bit Android (Aarch64). Resulting APK will only support 32-bit Android devices.

Thanks for your answer. I verified: yes,
castle-engine package --target=android
It works fine. It creates both 32 and 64bit code inside the APK. And I found that it’s well written about it in Android wiki :slight_smile:

1 Like

Thank you for noticing it. I have FPC 3.2.0. So it works fine now.