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:

  CouchbaseLite.init(context)
                val cfg = DatabaseConfigurationFactory.create()
                db = Database(dbName, cfg)
Fatal Exception: java.lang.UnsatisfiedLinkError: No implementation found for long com.couchbase.lite.internal.core.C4Database.open(java.lang.String, 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.open(C4Database.java)
       at com.couchbase.lite.internal.core.C4Database.getDatabase(C4Database.java:156)
       at com.couchbase.lite.AbstractDatabase.openC4Db(AbstractDatabase.java:1069)
       at com.couchbase.lite.AbstractDatabase.<init>(AbstractDatabase.java:271)
       at com.couchbase.lite.AbstractDatabase.<init>(AbstractDatabase.java:246)
       at com.couchbase.lite.Database.<init>(Database.java:73)

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:

  CouchbaseLite.init(context)
  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 com.couchbase.lite.internal.core.C4Database.open(java.lang.String, 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.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.