

- #HOW TO MIGRATE TO GRADLE IN ANDROID STUDIO 3.0.1 HOW TO#
- #HOW TO MIGRATE TO GRADLE IN ANDROID STUDIO 3.0.1 CODE#
To compile and debug native code for your app, you need the following components: If you manually configured your project to build its native code by calling ndk-build, follow this guide to either link Gradle directly to the Android.mk build script or migrate to CMake. Before you use this guide to migrate your project to use CMake, go to your build.properties file and remove the following line: If you are using the deprecated ndkCompile in your project, you should start using stable Gradle with CMake integration.

CMake is a more effective way to build C/C++ code due to its mature syntax. However, if you are starting a new project and want to use a non-experimental build system, you should use CMake. Note: Support for ndk-build is included due to the large number of legacy projects. Alternatively, to start using stable Gradle with CMake integration right away, you can download Android Studio 2.2 and try out these sample apps. If want to switch to the stable Gradle plugin because the experimental plugin is unable to meet your current needs, you can follow this guide to migrate your project to use the stable version of Gradle with CMake. If none of the above apply to you, and you want to continue building your native code using Gradle, you can choose to keep using the experimental plugin. You want to build your C/C++ code for multiple platforms You have a large project that is unable to assume the risk of using an experimental version of the plugin Your project already uses CMake or ndk-build While the experimental version of the Android Plugin for Gradle also includes NDK integration for building JNI applications, and is under ongoing development, there are a few reasons you may want to consider using CMake or ndk-build with the stable version of the Gradle plugin:
#HOW TO MIGRATE TO GRADLE IN ANDROID STUDIO 3.0.1 HOW TO#
For more information, learn how to Add C and C++ Code to Your Project using Android Studio. Using Android Studio, you can edit and debug your native code while still using either external build system to compile and link the C/C++ sources. Android Studio 2.2 and higher support building C/C++ components of your Android project with two new options: CMake and ndk-build.
