emKaroly
emKaroly

Reputation: 796

Android NDK: How to build for ARM64-v8a with minimumSdkVersion = 19

I have an Android Library project which has a part in C/C++ via Android NDK. I want to build my native code for all architectures. If i set minSdkVersionto 21 it all works fine. but i need to have lower minSdkVersion(SDK 19) if i set minSdkVersion to 19 the ARM64-v8a version is not built. I know that there are no ARM64-v8a devices running SDK 19. How can i achieve to have all platforms built in one APK and have minSdkVersion 19?

Upvotes: 5

Views: 11878

Answers (1)

Sheikh
Sheikh

Reputation: 1146

Actually, there is typo in "minimumSdkVersion". The right attribute is "minSdkVersion".

However, arm64-v8a library should be successfully built for API 19, because NDK build scripts will automatically take right set of platform headers and libraries.

If you are using Gradle build scripts try to set it as one of target ABIs:

ndk { abiFilters 'arm64-v8a', 'armeabi-v7a' }

Then, explicitly set target platform for native build.
If you use CMake, then in gradle script set:

externalNativeBuild { cmake { arguments '-DANDROID_PLATFORM=android-19' } }

If you use ndk-build, then in your Application.mk set:

APP_PLATFORM := android-19


I hope that helps. Please, write details if it will not build.

Upvotes: 5

Related Questions