I have a java class that holds singletons and I want to access these singletons in native JNI code.
The class looks like this
package com.ammar.sharing.common; // imports public class LiveDataSingletons { // singletons }
I use rust lang as my JNI code.
This is the code that accesses the class.
jni::bind_java_type! { pub(crate) LiveDataSingletonsJava => com.ammar.sharing.common.LiveDataSingletons, fields { // static fields } }
However when I try to access LiveDataSingletonsJava in rust I get the following error in logcat.
failed to resolve Java class 'com/ammar/sharing/common/LiveDataSingletons' (class not found or linkage error)
I can call android java API from rust but I cannot call my own Java code.