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

I came across this very strange error message in Android Studio. It is displayed on top of my own code built using ndk-buildGradle. Breakpoints and step code work fine, but the code is completely littered with "errors" such as "Unable to resolve a variable."

Here is an example of what it looks like:

enter image description here

Again, the code is working correctly, just like the IDE, it seems it is not able to resolve a whole bunch of types. On the right side you see an illustration of errors. Basically, each line is flagged as an error, although all of it compiles just fine. I don’t know what is going on!

+4
source share
2 answers

I believe that performing the following operations fixed the problem:

  • Manually delete a folder build/intermediates/ndkBuild/debug/obj/local

  • Launch Refresh Linked C++ Projects

+7
source

I had it in Android Studio 3.0 for MacOS. There was a space in my path to the project (for example, "/ Users / sergei / _Projects / Project-build / Project CPP / android / app"), and that was the problem. So I just renamed "Project CPP" to "ProjectCPP" and the problem was fixed. Hope this can help someone.

+1
source

Source: https://habr.com/ru/post/1657922/


All Articles