Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Application.mk is ignored by Android Studio

I would like to include c++ header iostream into my NDK code. In order to do that, I have to include APP_STL := stlport_static (or similar) into Application.mk file as mentioned in Android ndk-build iostream: No such file or directory.

It all works well if I compile using command line ndk-build, however while compiling using Android Studio, I still get the same error as iostream not found. It looks like application.mk is ignored by Android Studio and I am not sure how to configure it in build.gradle. Can anyone help me including APP_STL := stlport_static using android studio?

Thanks

like image 315
Androidme Avatar asked Jan 13 '15 11:01

Androidme


1 Answers

It looks like at the moment there is no support for including Application.mk file in build.gradle, however adding stl "stlport_static" under ndk section of build.gradle works well (thanks Michael for quick reply).

Under defaultConfig section, add:

    ndk {
        moduleName "app"
        stl "stlport_static"
    }

Details can be found at: https://groups.google.com/forum/#!topic/adt-dev/pHnST37HrlM

like image 126
Androidme Avatar answered Oct 05 '22 19:10

Androidme