How to compile rd4j as a core library - Punya

Hello, I’m referring to the last message-thread with @Antus about Punya .
In order to avoid problems related to rdf4j META-INF/services not included when building the apk, I would like to compile rdf4j as a core library, instead of as an extension. How could I do? Is there a simple way to do this?
Thanks for your time.