I have an Android application, a JNI code which captures images from Camera and sends it to UI. JNI code runs in a separate thread which fills a shared queue which is present in UI class. Randomly I am getting the following error.
W/dalvikvm( 360): JNI WARNING: 0x659 is not a valid JNI reference
W/dalvikvm( 360): in Ldalvik/system/NativeStart;.run ()V (NewLocalRef)
I/dalvikvm( 360): "Binder Thread #3" prio=5 tid=8 RUNNABLE
I/dalvikvm( 360): | group="main" sCount=0 dsCount=0 s=N obj=0x4515e1b8 self=0xa5770
I/dalvikvm( 360): | sysTid=457 nice=0 sched=0/0 cgrp=unknown handle=2280392
I/dalvikvm( 360): at dalvik.system.NativeStart.run(Native Method)
I/dalvikvm( 360):
E/dalvikvm( 360): VM aborting
Let me know how to fix this issue. Issue occurs while displaying first image or after some images.
Some more Info: It is crashing after calling NewLocalRef on a variable.