Using include_dirs is the correct approach. From what you write in your description it should work.
Here are some suggestions for error checking:
Is vendor/external/include actually a subfolder of $ANDROID_BUILD_TOP?
Directories in include_dirs have to be specified relatively to the AOSP root directory. If the path is relative to your Android.bp you have to use local_include_dirs instead.
cc_binary {
name: "my-module",
srcs: [ "main.cpp" ],
include_dirs: [ "vendor/external/include" ]
}
Is the cpp file in the srcs list of the same module definition as include_dirs?
If you want to inherit the include directory from a library your module depends on, then the library should use export_include_dirs.
cc_library {
name: "my-library",
export_include_dirs: [ "include" ]
}
cc_binary {
name: "my-module",
srcs: [ "main.cpp" ],
static_libs: [ "my-library"]
}
What include dirs are provided to the compiler when you build your module?
Rebuild your module and check the -I options.
m my-module | grep "main.cpp" | sed 's/-I/\n-I/g'