JNIEnv::find_class resolves against the system classloader on a thread attached from native code, which cannot see APK classes (#5629). Route the generated #[manganis::ffi] type lookup through load_class_from_classloader, and reimplement that helper to ask the activity's own ClassLoader.loadClass instead of Class.forName. Ask the activity INSTANCE, not its Class: Context.getClassLoader() is documented to return a loader for the application package unconditionally, whereas Class.getClassLoader() returns null for classes loaded by the bootstrap loader. Describe and clear the pending Java exception on every error path. jni 0.21 leaves the exception pending when a call returns Err, and the next JNI call then aborts the process with 'JNI DETECTED ERROR IN APPLICATION: ... called with pending exception' -- which is what turns a recoverable ClassNotFoundException into an unreadable ART abort.
Manganis Macro
This crate contains the macro used to interact with the Manganis asset system.