Can I force use armeabi-v7a vs arm64-v8a according to Android API LEVEL?

1.1k Views Asked by At

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

1

There are 1 best solutions below

2
PramUkesh N On

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.