Building a native Android* app with Intel® C++ Compiler in Android Studio*

Published: 05/19/2016, Last Updated: 05/19/2016


This article provides the steps on how to build a native Android* app using Android NDK and Intel(R) C++ Compiler for Android in Android Studio* 3.0. The current Android Studio* release is 3.0.1 at the time of this writing.

The workflow was changed in comparison to Android Studio 2.3. Now it is possible to use Gradle features such as "externalNativeBuild” to build the native module with Intel(R) C++ Compiler. The instruction was much simplified in Android Studio 3.0.

Required Software Tools

  • Android Studio 3.0
  • Android Gradle Plug-in 3.0
  • Gradle 4.1
  • Android SDK Build Tool 26.0.2 or later
  • Android NDK r15c or later  (assumed to be installed at: [ndk-dir] )
  • Successful installation of Intel System Studio 2018 with Intel C++ Compiler integrated into Android NDK

Using Intel(R) C++ Compiler in Android Studio* 

We will use a sample from Android NDK samples to demonstrate the use of Intel C++ Compiler with Android Studio* 3.0.

Download samples from and extract them.

Open Android Studio, click File > New > Open Project. Navigate to Android NDK samples location and select hello-jni sample.

If you see “Android Gradle Plugin Update Recommended” message, please update it.

If you see the error below, please click “Update Build Tools version and sync project”

Open file. It should contain path to Android NDK. Set up “ndk.dir” variable with path to Android NDK with integrated Intel® C++ compiler:


Configuring your application to run ndk-build with Intel(R) C++ compiler

Open "app\build.gradle" file:

Add the following lines inside defaultConfig section.

externalNativeBuild {
    ndkBuild {
        abiFilters 'x86_64'
        arguments "V=1 NDK_TOOLCHAIN:=x86_64-icc"

Save Changes.

Now build the project: select [Build > Make Project]. The lib "" will be generated inside hello-jni\app\build\intermediates\ndkBuild\debug\obj\local\x86_64 and get included inside your APK.

If you want to build your application for x86 target, change ndk abifilters to x86:

externalNativeBuild {
    ndkBuild {
        abiFilters 'x86'
        arguments "V=1 NDK_TOOLCHAIN:=x86-icc"


Now you know how to build a simple native Android app with Intel C++ Compiler in Android Studio. Try it with your real native application and let us know how it goes.



Product and Performance Information


Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804