Search code examples
android-studioandroid-ndkgradle-experimental

Switching between GCC and Clang when using the Gradle Experimental NDK plug-in in Android Studio


When using the Gradle Experimental NDK plug-in in Android Studio, how do you configure the Gradle build settings to build using Clang vs GCC (which has been deprecated)?


Solution

  • Have you tried to specify

    toolchain = 'gcc'

    in the model.android.ndk block in your build.gradle?

    You can see the toolchains here: https://docs.gradle.org/current/javadoc/org/gradle/nativeplatform/toolchain/package-summary.html