"Failed to get the compiler information for file ..." in Android Studio

android, android-ndk, android-studio

Solution

I believe that performing the following operations fixed the issue:

Manually removing the directory `build/intermediates/ndkBuild/debug/obj/local`

Running `Refresh Linked C++ Projects`

Problem

I'm running into this really bizarre error message in Android Studio. It shows up on top of my native code built using `ndk-build` through Gradle. The breakpoints and code stepping are working properly, but the code is absolutely littered with "errors" like "Can't resolve variable". Here's an example of what it looks like: Again, the code all runs correctly, it's just like the IDE doesn't seem to be able to resolve a whole bunch of the types. You can see the litany of errors on the right hand side. Basically every line is marked as an error even though it all compiles just fine. No idea what's going on!

Original source