I'm building an android app which uses NDK and Java. The app is working fine in debug mode. But when I try to build release apk. It starts crashing. After debugging the release APK I found that
JNI DETECTED ERROR IN APPLICATION: JNI GetMethodID called with pending exception java.lang.ClassNotFoundException: Didn't find class "example.motion.MotionDetectionReturnValue"
Here's the problem from my .cpp class
jobject object;
jmethodID constructor;
jclass cls;
cls = env->FindClass("example/motion/MotionDetectionReturnValue");
constructor = env->GetMethodID(cls, "<init>", "(DDDDDDD)V");
object = env->NewObject(cls, constructor, avg.x, avg.y, totalFraction, bottomRightFraction, bottomLeftFraction, topRightFraction, topLeftFraction);
should I attach it to java thread or something like that. I tried but I didn't get it
What am I missing ? ..Thanks