Android.mk & Application.mk are not generated by Android Studio

时间:2017-06-15 09:48:46

标签: java android c android-studio android-ndk

I'm trying to compile a C program and connect it with JNI. It's been a few years since my last encounter with Android NDK. As far as I remember, Android Studio's ndk project used to have a JNI folder with Android.mk and Application.mk file.

The Android.mk file was responsible for compiling the native code and Application.mk file was responsible for creating a lib file of the jni code that would be used on Java side.

However the Android NDK project generate by Android Studio 2.3.2 seems completely different.

The JNI folder is replaced by cpp folder that contains CMakeList.txt and a .c file. I couldn't find Android.mk file and Application.mk file anywhere. However the app works fine when I run it using play button.

But what if I add a C program Eg. MyCProgram in cpp folder that has its own Cmake file that call Cmake files of other C programs connected to it. I'm not sure how would I do that.

I have tried to compile the Android NDK project using ndk-build but it gives me this error:

Android NDK: Could not find application project directory !
Android NDK: Please define the NDK_PROJECT_PATH variable to point to it.

Which probably is related to the missing Android.mk and Application.mk files.

Please excuse my ignorance in Native C development in Android and kindly tell me where can I find the Andriod.mk & Application.mk files and what changes have been introduced on NDK side that I should know?

0 个答案:

没有答案