Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded library cannot be found #81

Open
percula opened this issue Dec 20, 2018 · 3 comments
Open

Embedded library cannot be found #81

percula opened this issue Dec 20, 2018 · 3 comments

Comments

@percula
Copy link

percula commented Dec 20, 2018

For the android-mobile todo example, I am experiencing the following exception upon build (without changing anything):

2018-12-20 10:35:01.605 5705-5705/com.mongodb.stitch.sdk.examples.todo E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.mongodb.stitch.sdk.examples.todo, PID: 5705
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mongodb.stitch.sdk.examples.todo/com.mongodb.stitch.sdk.examples.todo.MainActivity}: com.mongodb.embedded.client.MongoClientEmbeddedException: The mongo embedded library could not be initialized
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2913)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:193)
        at android.app.ActivityThread.main(ActivityThread.java:6669)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
     Caused by: com.mongodb.embedded.client.MongoClientEmbeddedException: The mongo embedded library could not be initialized
        at com.mongodb.embedded.client.MongoClients.init(MongoClients.java:49)
        at com.mongodb.stitch.android.services.mongodb.local.internal.AndroidEmbeddedMongoClientFactory.<init>(AndroidEmbeddedMongoClientFactory.java:33)
        at com.mongodb.stitch.android.services.mongodb.local.internal.AndroidEmbeddedMongoClientFactory.getInstance(AndroidEmbeddedMongoClientFactory.java:41)
        at com.mongodb.stitch.android.services.mongodb.local.LocalMongoDbService$1.getClient(LocalMongoDbService.java:53)
        at com.mongodb.stitch.android.services.mongodb.local.LocalMongoDbService$1.getClient(LocalMongoDbService.java:44)
        at com.mongodb.stitch.android.core.internal.StitchAppClientImpl.getServiceClient(StitchAppClientImpl.java:110)
        at com.mongodb.stitch.sdk.examples.todo.MainActivity.onCreate(MainActivity.java:87)
        at android.app.Activity.performCreate(Activity.java:7136)
        at android.app.Activity.performCreate(Activity.java:7127)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808) 
        at android.os.Handler.dispatchMessage(Handler.java:106) 
        at android.os.Looper.loop(Looper.java:193) 
        at android.app.ActivityThread.main(ActivityThread.java:6669) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 
     Caused by: com.mongodb.embedded.capi.MongoEmbeddedCAPIException: 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.
        at com.mongodb.embedded.capi.MongoEmbeddedCAPI.create(MongoEmbeddedCAPI.java:87)
        at com.mongodb.embedded.client.MongoClients.init(MongoClients.java:46)
        	... 21 more
     Caused by: java.lang.UnsatisfiedLinkError: Unable to load library 'mongo_embedded': Native library (android-x86/libmongo_embedded.so) not found in resource path (.)
        at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:303)
        at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:427)
        at com.sun.jna.Native.register(Native.java:1647)
        at com.mongodb.embedded.capi.internal.CAPI.<clinit>(CAPI.java:164)
        at com.mongodb.embedded.capi.MongoEmbeddedCAPI.create(MongoEmbeddedCAPI.java:84)
        	... 22 more
@YovoManolov
Copy link

YovoManolov commented Mar 10, 2019

Hi my friend, have you found an answer for your problem, I've encountered the same one ?

@percula
Copy link
Author

percula commented Mar 12, 2019

@YovoManolov , I believe it is because we need to initialize the app client. See this other issue I created: mongodb/stitch-android-sdk#85 (comment)

Unfortunately I haven't had time to test this yet.

@mdg-2018
Copy link

Just in case anyone comes across this in the future, the issue here is likely that the Android emulator that you're using is set to x86 rather than x86_64. I ran into this issue and after changing the emulator settings it worked fine.

Docs here: https://docs.mongodb.com/stitch/mongodb/mobile/getting-started/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants