After trying for almost a month now got the solution. Putting it here if anyone faces similar issue in future.
So, before my opencv gradle file looked this sourceSets {
main {
jniLibs.srcDirs = ['native/libs']
java.srcDirs = ['java/src']
aidl.srcDirs = ['java/src']
res.srcDirs = ['java/res']
manifest.srcFile 'java/AndroidManifest.xml'
}
}
I just added a single line in my sourceSets which is this jni.srcDirs = ['native/jni', 'native/libs/']
So basically my jni.srcDirs path was missing. Also, I have added the entire OpenCV sdk and not only Java folder unlike others.
UPDATE:
After adding above code I generated signed Bundle and tried uploading to Play Store but the Play Store refused the app. Then I removed
debuggable true
from app gradle file and kept it only inside the opencv gradle file and it worked despite removing the above code.
So, play store doesn't accepts the bundle if you have set
debuggable true
for your app level gradle file but accepts if any module which has
debuggable true
in it's gradle.
The problem was not in the jni.
can you please post your code?
i think you doing something wrong in your code because i think oncameraFrame() return same result in debug or signed apk. it's not return different output for different build variants.
Code:
This code works well expect for release apk/bundle.
If my code is wrong then why it's working in debug apk and not in signed?
yes you are right but i have also use onCameraFrame() and it's working fine in both debug and signed