0

I am building native library using NDK21d for 2 archs: armeabi-v7a and arm64-v8a.

I am embedding both libraries .so (32 and 64) inside the APK, which has minsdkversion set to 21.

But I am facing an issue where the C function __register_atfork is not defined in arm64 library if API Level < 23 (21 and 22 = Android 5.x, e.g. Lollipop).

So, as a workaround I would like to force usage of armeabi-v7a for Lollipop devices, even if they support 64 bits.

Is that possible ? In the build.gradle ?

Thanks in advance

Olive
  • 1
  • 2
  • Unless you're calling `__register_atfork` explicitly this sounds like a bug in your build system. – Dan Albert Oct 20 '21 at 16:36
  • Some of externals libraries embedded by my internal library do use it. So it is requirement to have it. More infos here: https://github.com/android/ndk/issues/964 – Olive Oct 21 '21 at 08:24

1 Answers1

-1

If there is no performance difference in app,

you can use armeabi-v7a arch only,

it will work on arm64 devices as they are compatible.

  • 2
    This is not true. 64-bit comes with significantly better performance for some workloads because it has hardware supported extensions not available to armeabi-v7a. 32-bit only apps also will not be uploadable to the Play store. 64-bit support is not optional. – Dan Albert Oct 20 '21 at 16:34
  • Indeed I need to embed both armeabi-v7a and arm64-v8a for PlayStore ... That's why I just want to make an exception for Android 5 devices only to force using arm32 libraries, because I know for sure that if they support 64bits, they will crash with the arm64-v8a lib. I have tested it in debug on an Android 5 device 64bits by specifying ndk { abiFilters "armeabi-v7a" } – Olive Oct 21 '21 at 08:18