Error: Insufficient memory (Failed to allocate 2040518915616 bytes) in OutOfMemoryError

i have created opencv android sdk from cource and created opencv aar for android project but in opencv lib I am getting OutOfMemoryError… Please any one can help to solve this issue

how so ? doing what ?
if there’s code, please show us.

Hello…
I have created opencv 4.9.0 android sdk from source code using build_sdk.py and i have exported that sdk to android and created opencv.AAR file to use in my android project.
After adding .aar file in my project and running my app I am getting this error “OutOfMemoryError” when creating a new mat object.

Can you please tell me the steps to generate opencv android sdk from source code. I am able to build sdk from 4.9.0 and 4.10.0 source code using build_sdk.py. but but not with older version like 4.2.0 - 4.7.0. It is aksing to turn OF android project build. Please help to solve the issue. I am new to this.