Fixed issue related to JNI static jclass pointer initialisation (ERROR "accessed stale local reference"), observable in Android ICS+ (>= Ice Cream Sandwich 4.0) because of the new garbage collector which moves memory allocations.
This was needed on my KitKat device despite targetSDKVersion set to 11 in project properties (which should normally ensure JNI compatibility mode with post-4.0 garbage collection ... I'm not sure why the compatibility mode did not kick-in though, I observed this bug in both Dalvik and ART runtimes).
Future uses of the jni::Class wrapper (defined in jni_class.h) should be double-checked, to ensure that the initialisation macro from helpers.h is used to create the correct persistent jclass memory pointer! (behind the scenes: (jclass)env->NewGlobalRef(tmpPtr)).
Perhaps INIT_CLASS_RETVAL() should be called directly inside the jni::Class constructor that takes a string parameter (the class qualified name, used to lookup via end->FindClass()). This would make the API transparent to the JNI garbage collection subtleties?