Android Studio 4.0 does not highlight and color native C++ code syntax

Viewed 350

Since Android Studio 4.0 update I am not able to see colored, syntax-highlighted native C++ code.

This also makes not possible to set a breakpoint in C++ code.

externalNativeBuild does get launched, CMake builds the code.

Also no code navigation.

When I have downgraded to Android 3.6.1 the whole Android native code support works fine.

How to fix this?

Example for cpp file

enter image description here

1 Answers

I had a similar problem, turns out I had to tell android studio that my project had c++ code in it.

In my case there was a option in the file menu (android studio for Mac version Artic Fox 2020.3.1) saying "add c++ to project" (or something like that, I can't get it back now).

When clicking that it asked me if I wanted to create a new CMakeList.txt file or if I had one already. Since I had one already I chose the latter, chose my CMakeList.txt and everything synched up correctly.

Related