ammcom
ammcom

Reputation: 1034

Android studio 3 c++ file full of errors but compilation is ok

I am using Android studio 3 to develop Android application that contains c++ code that are compiled using cmake and NDK, the compilation is ok and the app runs correctly, but when I try to edit cpp file, the inline compiler shows a lot of errors, all standard header files are missing, this is very annoying as I cannot know if I make any compilation error until I run the app, I am not using any special configuration in cmake or in cradle file, any suggestion to fix the problem?

Upvotes: 7

Views: 1317

Answers (2)

Gil Moshayof
Gil Moshayof

Reputation: 16771

Found a solution:

  1. Close Android Studio
  2. In command-line, delete the .idea folder in your project's root folder.
  3. Open Android Studio, invalidate caches and restart.
  4. Open AS again, sync gradle.

If the above steps don't work, try setting your gradle version to 3.3 (if it's not that already), and try the above steps again.

Upvotes: 2

Dan Albert
Dan Albert

Reputation: 10509

CLion (the C++ IDE that Android Studio is based on) does not have a perfect C++ parser. I believe there's a fix for the most common issue (not properly handling SFINAE) coming Soon.

Upvotes: 1

Related Questions