0

First off, here are my SDK versions just for clarity:

  • Android Studio Version = 3.3.2
  • Android SDK Build-Tools = up to 28.0.3
  • Android SDK Platform-Tools = 28.0.1
  • Android SDK Tools = 26.1.1
  • LLDB = 3.1 (libc++, which supports c++17)
  • CMake = 3.10.2.4988404
  • NDK = 19.1.5304403

Essentially, I'm attempting to use std::make_unique<>() in my native-lib.cpp file. I have included <memory>, where make_unique is defined in. Android Studio gives an error in the editor, saying: Cannot resolve namespace member 'make_unique'. However if I build the project, it compiles just fine.

I've researched this, and made some attempts to solve this via modifying my compiler options (by adding -std=c++14, and -std=c++17 to my build.gradle file), as well adding the following line (to CMakeLists.txt) from the oboe tutorial:

target_compile_options(native-lib
    PRIVATE -std=c++14 -Wall -Werror "$<$<CONFIG:RELEASE>:-Ofast>")

Neither of these even matter anyway as libc++ should support c++17 functionality. I can compile/build my project fine even with this red item in my IDE.

I have also tried deleting my .gradle, and .idea directories then cleaned, re-synced, and built the project again with no avail.

Is this a potential bug with Android Studio, or does anyone else notice this problem? Any help would be appreciated, but I suppose at this point I'll just have to either ignore it or use this answer: https://stackoverflow.com/a/24609331/10013384

Matt Strom
  • 698
  • 1
  • 4
  • 23

0 Answers0