No NDK Camera support in prebuilt 4.9.0 binary for Android?

I am trying to use OpenCV v4.9.0 for Android to open a camera in my Native C++ code, but got failure after trying different index and api combinations. When trying cv::CAP_ANDROID, I got this error

[ WARN:0@0.002] global cap.cpp:344 open VIDEOIO(ANDROID_NATIVE): backend is generally available but can’t be used to capture by index

Below is my code:

cv::VideoCapture cap;
int index = 0; //also tried 1, 32 and 33. The device has a camera module and can see video0, video1, video32 and video33 under/dev
int api = cv::CAP_ANDROID; //also tried cv::CAP_V4L2 and cv::CAP_ANY
cap.open(index, api);
if (!cap.isOpenend())
{
//handle errors
}

I downloaded OpenCV 4.9.0 for Android from here , and while looking at the output of cv::getBuildInformation() , I noticed this

Video I/O:
MEDIANDK: YES
NDK Camera: NO

Could this be the cause of my issue? Is “NDK Camera NO” expected for the prebuilt libopencv_java4.so in the release verion?

For my C++, I am using NDK 26.1.10909125

crosspost and solution (build from source):

The StackOverflow article you linked were actually my post over there. Someone suggested I open an issue with OpenCV github but I later on found out the prebuilt OpenCV shared library from official website indeed doesn’t have NDK Camera support. I can build one from source with NDK Camera support.