I am trying to use MongoDB in an Android project by following this guide:
https://docs.mongodb.com/stitch/mongodb/find-documents-in-mongodb/
But the application is crashing at the following line:
val mongoClient = stitchClient.getServiceClient(RemoteMongoClient.factory, "mongodb-atlas")
with the following message
com.mongodb.embedded.client.MongoClientEmbeddedException: The mongo embedded library could not be initialized
Server error message: Unable to load the Mongo Embedded Library.
Please either: Set the libraryPath when calling MongoEmbeddedCAPI.create or
Ensure the library is set on the jna.library.path or the java.library.path system property.
....
....
Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'mongo_embedded': Native library (android-x86/libmongo_embedded.so) not found in resource path (.)
But when I run the application on my phone it is working. Any ideas why it is crashing on the virtual emulator.