Android Studio hides files in native source folder subdirectories

Viewed 195

I want to use the android ndk in my existing java android library. I have set up everything, compiling and running works. (Unit tests that use jni complete successfully) This is how my file structure looks like:

File structure (Project view)

When I switch from "Project" to "Android" view in the project explorer it looks like this (as expected):

Android View

I want to move test.cpp, test.h and test_jni.cpp to a subdirectory to organize like this:

File structure with subdir (Project view)

But as soon as i make that change and switch to "Android" view again, the files are not displayed anymore:

Android View (missing files)

When I adjust the CMakeLists to look for those files in the subdirectory, everything still works but the files are still hidden. Why doesn't android studio display those files? What do I have to do to make it work? It would be very messy to put every h/cpp file into the root folder.

1 Answers

Try clearing indexes (go to File > Invalidate Caches / Restart) or restarting AndroidStudio manually. If it doesn't help, just fill in a bug report, and pray for it being fixed ;)

Related