Unable to use KotlinDriver

So I recently tried to connect to my cluster via the kotlin driver in an android app. But when I try to start a connection (or use the library at all), I get this error:

 java.lang.NoClassDefFoundError: Failed resolution of: Ljavax/naming/directory/InitialDirContext;
at com.mongodb.internal.dns.JndiDnsClient.createDnsDirContext(JndiDnsClient.java:73)


Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.naming.directory.InitialDirContext" on path: DexPathList[[zip file "/data/app/com.lucaperri.gima-gGprbMQgcl8fKcewyK1Gjg==/base.apk"],nativeLibraryDirectories=[/data/app/com.lucaperri.gima-gGprbMQgcl8fKcewyK1Gjg==/lib/arm64, /system/lib64, /hw_product/lib64, /system/product/lib64, /prets/lib64]]

Does anybody know on how to fix this issue? I am using org.mongodb:mongodb-driver-kotlin-coroutine:4.11.1

Hello! You can connect to MongoDB with Kotlin in a few ways –

You mention that this is for Android. In that case, I’d recommend using the Kotlin SDK (second link above).

Hi, thanks for the response.

I have tried tried using the kotlin coroutine, realm aswell as both java drivers (sync and the stream.)
This issue still persists, through all libraries and all drivers.

I am not sure on what to do, since there’s is neither a documentation, nor a solution online.

Have you had a look at https://www.mongodb.com/docs/realm/sdk/kotlin/app-services/? There is a quick start tutorial that might prove useful.