Q:

How to change ndk setting from default C++ toolchain to C++14 after project is created?

I created an Android project with default C++ toolchain. Now when I was trying to include code snippets from sample projects on oboe containing C++14 features I keep on getting errors. So I tried included code to create a template but now it is making my code messy and dumped with the declarations which I will prefer not to have.
I tried referring to following questions.

Enable C++11 support on Android
How to Compile C++14 code for Android?

But all these answers seem outdated or I am missing something.
There is no Android.mk file in my project structure neither I can find settings that they are suggesting to change.
I suspect the Android studio interface was changed after posting these answers. So what is the right way to change C++ toolchain version in Android Studio 3+?

A:

You specify it in your app/build.gradle script.
android {
    defaultConfig {
        externalNativeBuild {
            cmake {
                cppFlags "-std=c++14"
            }
        }
    }
}

Change cmake to ndkBuild depending on which method you're using.

