I am trying to build a dynamic library for Android that would be based on Juce so that I can link it with a ReactNative project.
The goal is to export some native functions with JUCE_JNI_CALLBACK so that they can be used in the React environment to use Juce audio engine.
It works great but as soon as I call the first method I’m encountering a SIGSEV. It seems that something tries to call getEnv in juce_android_SystemStats.cpp and that the JNIEnv pointer isn’t set yet.*
A little bit more about the context.
As you know Jucer isn’t really compatible with a dynamic library project and the Android platform.
It will create an app project and not an AAR one. Therefore I’ve manually changed the gradle so that it builds a dynamic library (apply plugin: ‘com.android.model.library’) and also removed the MainActivity that the Jucer pre-generates. I assume this is not calling some of the initialization lines that are mentioned in this thread:
I’d really like to avoid writing a Dummy app but perhaps I could make sure the the relevant variables are initialized manually during the initialization of my library. How could I do this properly?
PS: I’m still on Juce 4 btw but afaik Juce 5 still doesn’t support the dynamic-library type for the AndroidStudio output either.