In 2017 Google had announced that android apps using native code must provide a 64-bit version of apk along with the standard 32-bit version. Support for 64 bit CPUs in Android had started from the release of Android Lollipop. To further this requirement Google has published explicit timelines, which can be found here
This requirement excludes apps
- which do not have native code
- are not built for Android wear, TV
- which do not target Android 9 or later
You need to verify our apps for 64-bit support before publishing an update or a new apk on Google play, so you do not get an error like below.Also according to the announcement, if your app does not support 64-bit versions, Google will stop serving your app to 64-bit capable devices starting August 1 2021.
Therefore, for your apps to run successfully on 64-bit only devices, you can use Android studio’s APK Analyser, which comes in handy to verify your apps support for 64-bit. You can access the analyzer in Android studio by going to the Build > Analyze APK option.
If you have any native libraries in your code, they should be listed under the lib folder according to supported ABI like below.
The only thing you need to make sure is that you have corresponding versions of your library in your ABI folders. If your library supports
- ARM Architecture
- you should be able to see armeabi-v7a (32-bit) & arm64-v8a(64-bit) folders
- x86 architecture
- you should be able to see x86 (32-bit) & x86_64(64-bit) folders
You may or may not have the same libraries for both architectures, but you need to have them in both 32-bit & 64-bit versions.
For third party libraries, you need to use an upgraded version of the library which supports both .
For native code support in Gradle with Android Studio, you can add – “ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
” in the defaltConfigs in build.gradle file.
For building with other options like CMAKE& Porting 32-bit code to 64-bit, you can refer here