I am developing a Xamarin Forms application using Couchbase Lite v1.4 as local database. Currently I am getting the well-known issue about “unauthorized access to libsqlite.so” on Android N devices.
I’ve seen that I need to use the NuGet package Couchbase.Lite.Storage.CustomSQLite instead of the old native Couchbase.Lite.Storage.SystemSQLite.
I’ve installed CustomSQLite but I am still getting the same error message. Besides, I’ve tried to uninstall the package SystemSQLite but it is defined as a dependency of Couchbase.Lite. Therefore now I have both packages installed and it seems that Couchbase is using the system one.
Is there any additional action to be done for consuming CustomSQLite instead of SystemSQLite?
Did you add the line Couchbase.Lite.Storage.CustomSQLite.Plugin.Register() ? If not it will continue to use the default one (System SQLite). The reason it is a dependency is because it is the default.
You resolve this by adding th custom SQLite package and calling it’s plugin register method. System SQLite simply won’t work on those devices. That’s google’s decision.
Have you cleaned, erased, reinstalled, etc the project and put in a breakpoint to make sure that the line is actually being called? I haven’t heard any issues like this before and calling that method is all you need to do to ensure that the custom sqlite plugin gets used instead.
@aalvarez I am facing the same issue, in my project I have reference added to Couchbase.Lite (version: 1.1.0.17194). Now if I add the reference to Couchbase.Lite.Storage.CustomSQLite, it will create reference related issues as I have to remove Couchbase.Lite. Is there any way to keep this both reference or add a single reference which will server both the purposes of exiting behaviour and removing warning “Unauthorized access to libsqlite”
You are out of luck with that version of Couchbase Lite. It was release in June 2015 before the Android requirement not to access SQLite. I’d strongly recommend updating to a version that hasn’t been out of extended support for almost 18 months (The entire 1.x line is past its end of life)