Couchbase Init Error

We have a function that initializes Couchbase Lite. A crash occurred when this function was called and it was recorded in FirebaseCrahslytics. I have never encountered this error during development, but I found it in FirebaseCrahslytics. Why did we get this error?

Our Init function body:

                val cfg = DatabaseConfigurationFactory.create()
                db = Database(dbName, cfg)
Fatal Exception: java.lang.UnsatisfiedLinkError: No implementation found for long, java.lang.String, int, int, byte[]) (tried Java_com_couchbase_lite_internal_core_C4Database_open and Java_com_couchbase_lite_internal_core_C4Database_open__Ljava_lang_String_2Ljava_lang_String_2II_3B)
       at com.couchbase.lite.internal.core.C4Database.getDatabase(
       at com.couchbase.lite.AbstractDatabase.openC4Db(
       at com.couchbase.lite.AbstractDatabase.<init>(
       at com.couchbase.lite.AbstractDatabase.<init>(
       at com.couchbase.lite.Database.<init>(

I’ll bet there are other errors, preceding that one. It looks as though the native library isn’t being loaded.

Without seeing the error on the attempt to load the library, I can’t really hazard much of a guess about what is going wrong…

You say there was an error loading the native library. But we do not know this process. This is how we init and use the db on the Android side:

  val cfg = DatabaseConfigurationFactory.create()
  db = Database(dbName, cfg) //issue was happened in this line

And we haven’t seen any other bugs before.

That call to CouchbaseLite.init(context) will try to load a native (written in C++) library. I am relatively certain that the load fails and that that failure will produce error messages. I need those error messages in order to diagnose the problem.

After the load fails, the attempt to open the database fails with the unsatisfied link error, because the attempt to load the native library failed earlier. The method

long, java.lang.String, int, int, byte[]

is defined in the native library.

I cannot think of a reason, that the library load would fail. It succeeds a lot, on a lot of devices. If we can just get those logs, though, I can probably sort it out.