triniwiz / nativescript-plugins

Apache License 2.0
78 stars 50 forks source link

[couchbase] IncompatibleClassChangeError on android #171

Open abdallahkadour opened 1 year ago

abdallahkadour commented 1 year ago

I get this issue when saving a document to the couchbase in Batch as follow:

this.database.inBatch(() => {
    documents?.forEach((document) => {
      const id = document._id ?? document.id
      let resultId
      if (id) {
        resultId = this.saveDocument(document, id)
      } else {
        resultId = this.saveDocument(document)
      }

      if (resultId) ids.unshift(resultId)
    })

env:

ns: 8.4.0 couchbase: 1.4.0 os: android @nativescript/android: 8.4.0


ERROR Error: java.lang.IncompatibleClassChangeError: Class 'com.tns.gen.java.lang.Runnable' does not implement interface 'com.couchbase.lite.UnitOfWork' in call to 'void com.couchbase.lite.UnitOfWork.run()' (declaration of 'com.couchbase.lite.AbstractDatabase' appears in /data/app/org.vois.international.mgov-lW6EdOhp8fjIxGEC85rYOA==/base.apk)
JS: save features will be called
JS: ERROR Error: java.lang.IncompatibleClassChangeError: Class 'com.tns.gen.java.lang.Runnable' does not implement interface 'com.couchbase.lite.UnitOfWork' in call to 'void com.couchbase.lite.UnitOfWork.run()' (declaration of 'com.couchbase.lite.AbstractDatabase' appears in /data/app/org.vois.international.mgov-lW6EdOhp8fjIxGEC85rYOA==/base.apk)
JS: ERROR Error: java.lang.IncompatibleClassChangeError: Class 'com.tns.gen.java.lang.Runnable' does not implement interface 'com.couchbase.lite.UnitOfWork' in call to 'void com.couchbase.lite.UnitOfWork.run()' (declaration of 'com.couchbase.lite.AbstractDatabase' appears in /data/app/org.vois.international.mgov-lW6EdOhp8fjIxGEC85rYOA==/base.apk)

I appreciate any help.

KG3RK3N commented 1 year ago

Should be fixed with #180