I tried to delete my couch database on the device with try Database.delete(dbName), but pretty often it failed with "Couchbase: failed to delete database [dbname] Error Domain=LiteCore Code=24 “Still 2 open connection(s) to path[/dbName]/db.sqlite3”
I stopped the replicator, removed change listener on both replicator and database before the delete, so I don’t know why there are still open connections.
It may take a moment for the replicator’s connection to close, since it’s running on a background thread. (What platform is this on?) Try pausing a second after stopping the replicator and see if that helps.