triniwiz / triniwiz/nativescript-plugins

[couchbase] IncompatibleClassChangeError on android

Open
#171 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C
Stars
87
Forks
57
Avg merge
1h 36m
Merged PRs (30d)
4

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the database.inBatch call and the supplied Android stack trace, using the listed NativeScript, Couchbase, and Android versions as the reproduction context. Investigate the interaction between Couchbase Lite UnitOfWork and the generated Runnable implementation; done means saving documents in a batch no longer raises IncompatibleClassChangeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, javascript
Domain
databases, mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.