Gradle + ndkbuild + android studio 2.2 how to install supported ABI?

I want to use Android studio integration with ndkbuild.

My "native" part of the project is built only for armeabi-v7a-hard and x86, and everything works fine if I just run ndk-build in the jni directory. I have the correct lines in Application.mk :

 APP_ABI := armeabi-v7a-hard x86 

To integrate the project into android studio, I added the following lines to build.gradle :

 externalNativeBuild { ndkBuild { path 'src/lib/jni/Android.mk' } } 

But for some reason gradle build try creating your own code with APP_ABI=armeabi and it failed, because my code can only be built using armeabi-v7a-hard .

So, how can I tell gradle to build my code only for armeabi-v7a-hard and x86 , or just not ignore the APP_ABI line from Application.mk ?

I try this option:

 defaultConfig { ndk { abiFilters 'x86', 'armeabi-v7a-hard' } } 

but gradle failed with this message:

ABI [armeabi-v7a-hard] are not available on the platform and will be excluded from the building and packaging. Available ABIs are [armeabi, armeabi-v7a, arm64-v8a, x86, x86_64, mips, mips64].

Note that I'm using ndk 10, not the last (ndk 13), where there is armeabi-v7a-hard and ndk.dir in local.properties to the right.

+8
android arm abi android-ndk
source share

No one has answered this question yet.

See similar questions:

5
How to create an executable for the Android shell

or similar:

3295
Why is the Android emulator so slow? How can we speed up Android emulator development?
2510
How to keep Android activity state by saving instance state?
8
Ndk-gdb error: device does not support application configured on CPU CPU ABI
3
APP_ABI is ignored
2
Compatible with ABI for Android
one
Creating an executable file for android
0
How to create a library with the same MODULE name for different ABIs from another source file in ndk?
0
null arguments NDK_PROJECT_PATH = null
0
Android Studio application works on a real device, but does not run on an emulator
0
Android ndkBuild android_gradle_build missing for ABI

All Articles