View all Clang arguments in Android Studio

3

Sometimes you may need to view all Clang command line arguments which are used to compile or link your native code in Android Studio. To do that run project build at least once and then go to the project root directory. After that navigate to:

app/.cxx/cmake/[configuration]/[platform]

So if you ran release build for arm64-v8a then your path is:

app/.cxx/cmake/release/arm64-v8a

Look for the file android_gradle_build.json — you will find compile arguments for each .c or .cpp file there.

Open the file build.ninja and look for the LINK_FLAGS variable — this is Clang's link arguments.

Share this page:

See also how to:

Select target architectures in Android Studio build
How to call your native functions in Android NDK application from Java
How to use JNIEnv::FindClass on Android and what you should know about it
How to open URL in web browser from Android NDK application with Java or native code
The most simple example how to show a message box on Android application