Couchbase mobile 1.4.1 in android 7.1.1

Dear,

My project are using couchbase mobile 1.4.1 for android. It is very slow on android 7.1.1. On iOS and on other androids versions we haven’t any problem with performance. I can’t update for couchbase 2.0 because my server is a couchDB.

Any Consideration?

Have you done any profiling to see where the time is going?

Thanks for reply. I tried to check where the error occurred but to no avail.

I have an application that works as follows: I sync with my CouchDB Server using the native API for android. After syncing I use the Android webview to read the html file which is inside the _design / doc as attachment with that url:

http: // localhost: 5984 / books3 / _design / books / books.html.

Inside this html file I make some queries for the couchbase lite database using javascript (xhttpRequest).

All ok in version 1.1.0.

After updating the couchbase to version 1.2, and today I am with version 1.4.4, my application became impractical for speed. I’ve got a way to make it faster by putting the html files out of _design/doc where they are currently in the assets folder of the android app. I then call them using the file: /// protocol. Everything works fine when I first synchronize using Replication pull.

When I do one more pull replication to receive new documents, my view (“http: // localhost: 5984 / books3 / _design / books / _view / l_books”) shows the following error:

Router unable to route request to do_GET_DesignDocumentcom.couchbase.lite.CouchbaseLiteException: Can not index view books / l_books: no map block registered, Status: 400 (HTTP 400 bad_request), “error”: “bad_request”, " “status”: 400}

Can you provide any tips about this error?

Does your app register a map function for the view every time it launches? It sounds like it does on the first launch, but not afterwards.

Could you give me a direction to register a map function for the view every time it launches because I have no idea to do this? Thanks Jens.

The CBL 1.x view docs explain registering map functions.

Or are you using JS map functions embedded in the design doc itself? If so, then this error means that the JS support for views isn’t enabled somehow.

Yes, my JS map function is inside _design / doc. I do not know why or where it might be disabling my view. Can this be a Couchbase bug?

I don’t know the Android version, but on iOS there is a separate module you have to link in to enable JavaScript view support.

Are you using PhoneGap/Cordova? Then this should be set up automatically.

Could you post the exact contents of your design document?

Dear Jens,

I`m not using PhoneGap/Cordova. I followed your tip and wrote and override native map functions (Java) in my main class. As this I gained again performance for the app.

Thank you for the tip.