I am trying to build an Android Java app using Android Studio 1.0.1. However, my app uses some C++ code that I build using the NDK as controlled by Android.mk and Application.mk files. But Android Studio tries its own build and gets it wrong as it is not using my *.mk files. I know there have been some answers how to do this for previous versions of Android Studio but they evidently do not work for 1.0.1.
So how do I disable Android NDK builds in Android Studio 1.0.1?
Just add the sourceSets.main.jni.srcDirs = []
to 'android' section of your build.gradle. This will disable automatic call of ndk-build with auto-generated Android.mk.
And yes, this line should be added to the project-specific gradle file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With