Chris623
Chris623

Reputation: 2532

Android NDK - Build does not find NDK includes such as <Queue>,

I have set up NDK as described in the installation guide, have set the PATH variable to my NDK installation.

Now when building my app in Android Studio, I'm getting a build error which says me that the include could not be found. This is my first NDK project so I guess that something is wrong with the configuration and the compiler does not know where to look for the include files.

I have also set the NDK-directory in the local.properties - file. The compiler can be found but the includes not.

Here is the compiler output:

Error:Execution failed for task ':app:compileDebugNdk'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: D:\android-ndk-r10c\ndk-build.cmd NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=D:\Programmieren\SoundTouch-Android-master\app\build\intermediates\ndk\debug\Android.mk APP_PLATFORM=android-20 NDK_OUT=D:\Programmieren\SoundTouch-Android-master\app\build\intermediates\ndk\debug\obj NDK_LIBS_OUT=D:\Programmieren\SoundTouch-Android-master\app\build\intermediates\ndk\debug\lib APP_ABI=all Error Code: 2 Output: D:\Programmieren\SoundTouch-Android-master\app\src\main\jni\soundtouch-jni.cpp:3:17: fatal error: queue: No such file or directory #include ^ compilation terminated. make.exe: *** [D:\Programmieren\SoundTouch-Android-master\app\build\intermediates\ndk\debug\obj/local/arm64-v8a/objs/soundtouch/D_\Programmieren\SoundTouch-Android-master\app\src\main\jni\soundtouch-jni.o] Error 1

I hope you have an idea and can help me.

Upvotes: 0

Views: 1204

Answers (1)

Alex Cohn
Alex Cohn

Reputation: 57173

Make sure your build.gradle includes this:

android.defaultConfig.ndk {
    stl "c++gnustl_static"
    abiFilter "armeabi"
}

Upvotes: 2

Related Questions