4

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?

2

1 Answer 1

9

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.