Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable the NDK build in Android Studio 1.0.1

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?

like image 335
Martin Ellison Avatar asked Jan 09 '23 00:01

Martin Ellison


1 Answers

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.

like image 117
Dmitry Moskalchuk Avatar answered Jan 25 '23 06:01

Dmitry Moskalchuk