initialiseJUCE in Android library used in Maui

Hi!
I am trying to build an Android .so library with Juce functionality and to use that library in a .net Maui application on Android. I managed to compile my Android library to an .so file, but I did not manage to initalize Juce in my library by calling
void Thread::initialiseJUCE (void* jniEnv, void* context)
because I do not know what pointers I should pass as parameters to the function above.
I found this post on StackOverflow which is about the same issue, but with Maui’s predecessor Xamarin. Based on the answer in the post I set my pointers as follows:

IntPtr jnienv = Android.Runtime.JNIEnv.Handle;
var currentContext = Microsoft.Maui.ApplicationModel.Platform.AppContext as global::Android.Runtime.IJavaObject;
IntPtr context = currentContext.Handle;

But this causes my Android application to crash with the following error:

[me.testapp] java_vm_ext.cc:594] JNI DETECTED ERROR IN APPLICATION: IsInstanceOf received NULL jclass
[me.testapp] java_vm_ext.cc:594]     in call to IsInstanceOf
[me.testapp] java_vm_ext.cc:594]     from android.view.View crc640ec207abc449b2ca.ShellSectionRenderer.n_onCreateView(android.view.LayoutInflater, android.view.ViewGroup, android.os.Bundle)

I suppose my pointers are not pointing to the right objects. I doubt especially that the second pointer is set right. Does anyone know what the pointers should point to?

same situation here, self android app with shared so of juce

Instead of call Thread:: initialiseJUCE, we need to call Java.initialiseJUCE() which initialize all the internal JNI classes. But need to remove System.loadLibrary(“juce_jni”); in the shared lib case

Hi! Thank you! Did you get it to work this way?
I have already given up on .Net Maui and decided to only use Juce for my implementations on mobile platforms. So far it works very well - much better than Maui…