1

I used this answer (https://stackoverflow.com/a/10965262/3178688) to get an executable successfully building as part of my Android application. I then tried to add a header file:

#include <linux/mmc/ioctl.h>

And the compilation starting failing with:

jni/mmc.c:1:29: fatal error: linux/mmc/ioctl.h: No such file or directory

This seemed to have something to do with the target platform, as this file is present in android-ndk/platforms/android-21/arch-*/usr/include/linux/mmc/ioctl.h but not in earlier platforms. I tried changing my minSdkVersion and targetSdkVersion in my app's build.gradle to 21 to no avail. I also tried including TARGET_PLATFORM=android-21 in my native code's Android.mk, also to no avail. How can I get the build system to see the android-ndk/platforms/android-21/arch-*/usr/include/linux/mmc/ioctl.h that is definitely there in my ndk?

Community
  • 1
  • 1
yumbrad
  • 44
  • 8
  • 1
    I believe you're supposed to set `APP_PLATFORM` in Application.mk, not `TARGET_PLATFORM` in Android.mk. How that works with gradle, I don't know. – Michael Jul 31 '15 at 19:46
  • @Michael I tried adding an Application.mk to my working setup, with the one line specifying `APP_PLATFORM := android-21` ... it worked! Thanks! Add as an answer if you'd like. – yumbrad Jul 31 '15 at 20:21
  • what about : ```#include ``` – Behrouz.M Dec 14 '16 at 08:09

0 Answers0