I'm a newbie in Android development and I have to work with Android NDK in Android Studio. When I write code in Android Studio, code can't be suggested, so quite difficult to work better. Does Anyone have solution for that? Thank you
-
did you ever figure this out? i want to get c++ autocomplete working too – prostock Aug 08 '16 at 19:03
-
1Thanks for the tip. This has something to do with the ndk-build package. I installed a previous build r13b in a separate directory and pointed to it in the project's local.properties file, invalidated cache with restart and suddenly code completion works again... – kleimola Mar 28 '17 at 14:57
-
if you solve your problem kindly tell me i want the solution – Tara Aug 02 '18 at 10:48
-
same problem with cmake based projects, for jni based projects, code completion works fine. – Summer Sun Apr 21 '19 at 06:19
3 Answers
I had the same issue for an Eclipse project that I imported in Android Studio. It turns out that the NDK path in the file local.properties was pointing to a previously installed version of the NDK, and not to the NDK downloaded by the SDK manager in Android Studio as it should now be the case. Updating the path in that file allowed me to recover autocomplete.

- 21
- 1
- 4
This previous post seems linked to your issue: Android Studio - Auto complete and other features not working
Regards.
-
2autocomplete work with java code but do not work with c/c++ code in ndk :( – Vinh Le Mar 17 '16 at 03:43
It works with C++ code as well. You need to specify your Cmakelists.txt file inside your build.gradle like this:
android {
externalNativeBuild {
cmake {
path file('jni/CMakeLists.txt')
version '3.18.1'
}
}
}
Also, make sure you have not enabled unity build with your Cmake build system as that leads to issues.
If you face any indexing issues, try to do Build -> Refresh Linked C++ projects in Android Studio.

- 1,619
- 1
- 15
- 20