Xamarin Forms app crashes when replication started on Android

I have a small test app that I use to test various aspects of Couchbase Lite and sync’ing with a Couchbase server. It simply shows the number of documents grouped by type - and updates the view if the replication adds/removes any documents.

I’ve just recently upgraded my mobile dev. environment to VisualStudio 2019, Xamarin Forms 3.6, Couchbase Lite 2.5, and Android 9.

The code is running fine in iOS Simulator and on physical iPhone. However, on Android (emulator or device) the app now crashes when I start replication:

[Mono] Loading reference 4 of /storage/emulated/0/Android/data/dk.dalsgaard_data.xamarin.Couchbase/files/.__override__/cb2.dll asmctx DEFAULT, looking for Couchbase.Lite, Version=2.5.0.0, Culture=neutral, PublicKeyToken=null
[Mono] Assembly Ref addref cb2[0x7d1cc98500] -> Couchbase.Lite[0x7d1cc98600]: 3
[Mono] Loading reference 3 of /storage/emulated/0/Android/data/dk.dalsgaard_data.xamarin.Couchbase/files/.__override__/Xamarin.Android.Support.Core.UI.dll asmctx DEFAULT, looking for Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
[Mono] Assembly Ref addref Xamarin.Android.Support.Core.UI[0x7d1cd83c00] -> Xamarin.Android.Support.Compat[0x7d1cd83a00]: 5
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_set_int_field'.
[Mono] Probing 'java_interop_jnienv_set_int_field'.
[Mono] Found as 'java_interop_jnienv_set_int_field'.
Instantiate cb2.Services.DbDataStore
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'c4_getVersion'.
[Mono] Probing 'c4_getVersion'.
[Mono] Found as 'c4_getVersion'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLSliceResult_Release'.
[Mono] Probing 'FLSliceResult_Release'.
[Mono] Found as 'FLSliceResult_Release'.
[CouchbaseLite] [1]| [Database] (Startup) [1] CouchbaseLite/2.5.0 (.NET; Android 8.1.0 [API 27]; LGE Nexus 5X) Build/190 LiteCore/09e4c055573721d63a5e0cf1405d273a18072f11 (1782) Commit/0080df3
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'c4log_binaryFileLevel'.
[Mono] Probing 'c4log_binaryFileLevel'.
[Mono] Found as 'c4log_binaryFileLevel'.
Thread started: <Thread Pool> #2
Thread started: <Thread Pool> #3
Thread started: <Thread Pool> #4
Thread started: <Thread Pool> #5
Loaded assembly: Anonymously Hosted DynamicMethods Assembly [External]
[CouchbaseLite] [1]| [Database] (Logging) [1] Database.Log.File.Config is null, meaning file logging is disabled.  Log files required for product support are not being generated.
[CouchbaseLite] [1]| [Database] (Database) [1] Opening database at /data/user/0/dk.dalsgaard_data.xamarin.Couchbase/files/fangst.cblite2
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'c4db_open'.
[Mono] Probing 'c4db_open'.
[Mono] Found as 'c4db_open'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'c4log_getDomainName'.
[Mono] Probing 'c4log_getDomainName'.
[Mono] Found as 'c4log_getDomainName'.
[CouchbaseLite] [1]| [Database] {N8litecore8DataFile6SharedE#1}==> N8litecore8DataFile6SharedE 0x7d0a390610 @0x7d0a390610
[CouchbaseLite] [1]| [Database] {N8litecore8DataFile6SharedE#1} instantiated on /data/data/dk.dalsgaard_data.xamarin.Couchbase/files/fangst.cblite2/db.sqlite3
[CouchbaseLite] [1]| [Database] {DB#2}==> N8litecore14SQLiteDataFileE /data/user/0/dk.dalsgaard_data.xamarin.Couchbase/files/fangst.cblite2/db.sqlite3 @0x7d0951b960
[CouchbaseLite] [1]| [Database] {DB#2} Opening database
Thread started:  #6
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'c4db_getDocumentCount'.
[Mono] Probing 'c4db_getDocumentCount'.
[Mono] Found as 'c4db_getDocumentCount'.
Database 'fangst' created
Log in with user: anonymous
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'c4socket_registerFactory'.
[Mono] Probing 'c4socket_registerFactory'.
[Mono] Found as 'c4socket_registerFactory'.
Try to start the replicator...
[CouchbaseLite] [1]| [Replicator] (Replicator) [1] Replicator[<*> ws://ds9.dalsgaard-data.dk:4984/data]: Starting
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLEncoder_New'.
[Mono] Probing 'FLEncoder_New'.
[Mono] Found as 'FLEncoder_New'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLEncoder_BeginDict'.
[Mono] Probing 'FLEncoder_BeginDict'.
[Mono] Found as 'FLEncoder_BeginDict'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLEncoder_WriteKey'.
[Mono] Probing 'FLEncoder_WriteKey'.
[Mono] Found as 'FLEncoder_WriteKey'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLEncoder_WriteString'.
[Mono] Probing 'FLEncoder_WriteString'.
[Mono] Found as 'FLEncoder_WriteString'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLEncoder_EndDict'.
[Mono] Probing 'FLEncoder_EndDict'.
[Mono] Found as 'FLEncoder_EndDict'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLEncoder_WriteBool'.
[Mono] Probing 'FLEncoder_WriteBool'.
[Mono] Found as 'FLEncoder_WriteBool'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLEncoder_WriteInt'.
[Mono] Probing 'FLEncoder_WriteInt'.
[Mono] Found as 'FLEncoder_WriteInt'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLEncoder_Finish'.
[Mono] Probing 'FLEncoder_Finish'.
[Mono] Found as 'FLEncoder_Finish'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLEncoder_Free'.
[Mono] Probing 'FLEncoder_Free'.
[Mono] Found as 'FLEncoder_Free'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'c4repl_new'.
[Mono] Probing 'c4repl_new'.
[Mono] Found as 'c4repl_new'.
Thread started:  #7
[CouchbaseLite] [1]| [Database] {DB#3}==> N8litecore14SQLiteDataFileE /data/user/0/dk.dalsgaard_data.xamarin.Couchbase/files/fangst.cblite2/db.sqlite3 @0x7d0951c4c0
[CouchbaseLite] [1]| [Database] {DB#3} Opening database
[CouchbaseLite] [1]| [Network] {N8litecore4blip10ConnectionE#4}==> N8litecore4blip10ConnectionE ->ws://ds9.dalsgaard-data.dk:4984/data/_blipsync @0x7d07d6fb10
[CouchbaseLite] [1]| [Network] {N8litecore4blip10ConnectionE#4} Opening connection...
[CouchbaseLite] [1]| [Replicator] Starting Scheduler<0x7d07a78e40> with 6 threads
[CouchbaseLite] [1]| [Replicator] {Repl#5}==> N8litecore4repl10ReplicatorE /data/user/0/dk.dalsgaard_data.xamarin.Couchbase/files/fangst.cblite2/ ->ws://ds9.dalsgaard-data.dk:4984/data/_blipsync @0x7d0a39b7c8
[CouchbaseLite] [1]| [Replicator] {Repl#5} Push=continuous, Pull=continuous, Options={{auth:{password:"********", type:"Basic", username:"anonymous"}, headers:{User-Agent:"CouchbaseLite/2.5.0 (.NET; Android 8.1.0 [API 27]; LGE Nexus 5X) Build/190 LiteCore/09e4c055573721d63a5e0cf1405d273a18072f11 (1782) Commit/0080df3"}, progress:1, reset:true}}
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'c4repl_getStatus'.
[Mono] Probing 'c4repl_getStatus'.
[Mono] Found as 'c4repl_getStatus'.
[CouchbaseLite] [1]| [Replicator] (Replicator) [1] Replicator[<*> ws://ds9.dalsgaard-data.dk:4984/data] is Connecting, progress 0/0
Thread started:  #8
[CouchbaseLite] [1]| [Replicator] (Replicator) [1] Replicator[<*> ws://ds9.dalsgaard-data.dk:4984/data] is Connecting, progress 0/0
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_FromData'.
[Mono] Probing 'FLValue_FromData'.
[Mono] Found as 'FLValue_FromData'.
New database: - 
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_GetType'.
[Mono] Probing 'FLValue_GetType'.
[Mono] Found as 'FLValue_GetType'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_AsDict'.
[Mono] Probing 'FLValue_AsDict'.
[Mono] Found as 'FLValue_AsDict'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLDict_Count'.
[Mono] Probing 'FLDict_Count'.
[Mono] Found as 'FLDict_Count'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLDictIterator_Begin'.
[Mono] Probing 'FLDictIterator_Begin'.
[Mono] Found as 'FLDictIterator_Begin'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLDictIterator_GetKey'.
[Mono] Probing 'FLDictIterator_GetKey'.
[Mono] Found as 'FLDictIterator_GetKey'.
Start replication timer...
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_AsString'.
[Mono] Probing 'FLValue_AsString'.
[Mono] Found as 'FLValue_AsString'.
Replication: Connecting to Sync.Gateway
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLDictIterator_GetValue'.
[Mono] Probing 'FLDictIterator_GetValue'.
[Mono] Found as 'FLDictIterator_GetValue'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLDictIterator_Next'.
[Mono] Probing 'FLDictIterator_Next'.
[Mono] Found as 'FLDictIterator_Next'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
Replication status: Couchbase.Lite.Sync.ReplicatorProgress - activity: Connecting. Completed: 0 of 0
[Mono] Searching for 'FLValue_IsInteger'.
[Mono] Probing 'FLValue_IsInteger'.
[Mono] Found as 'FLValue_IsInteger'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_IsUnsigned'.
[Mono] Probing 'FLValue_IsUnsigned'.
[Mono] Found as 'FLValue_IsUnsigned'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_AsInt'.
[Mono] Probing 'FLValue_AsInt'.
[Mono] Found as 'FLValue_AsInt'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_AsBool'.
[Mono] Probing 'FLValue_AsBool'.
[Mono] Found as 'FLValue_AsBool'.
Thread finished:  #8
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_get_object_field'.
[Mono] Probing 'java_interop_jnienv_get_object_field'.
[Mono] Found as 'java_interop_jnienv_get_object_field'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '__Internal'.
[Mono] DllImport loaded library '(null)'.
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'CreateNLSocket'.
[Mono] Probing 'CreateNLSocket'.
[Mono] Found as 'CreateNLSocket'.
Thread started: <Thread Pool> #9
[Choreographer] Skipped 56 frames!  The application may be doing too much work on its main thread.
[zygote64] Do partial code cache collection, code=17KB, data=29KB
[zygote64] After code cache collection, code=17KB, data=29KB
[zygote64] Increasing code cache capacity to 128KB
[zygote64] Compiler allocated 4MB to compile void android.view.View.<init>(android.content.Context, android.util.AttributeSet, int, int)
[] * Assertion at /Users/builder/jenkins/workspace/xamarin-android-d16-0/xamarin-android/external/mono/mono/metadata/threadpool-io.c:368, condition `fd >= 0' not met
[libc] Fatal signal 6 (SIGABRT), code -6 in tid 3923 (Thread Pool I/O), pid 3660 (marin.Couchbase)

The code has run with Couchbase Lite 2.1.2 and Visual Studio 2017, Xamarin Forms 3.1, and Android 8.

I just did some extra tests on another project… where Couchbase Lite and Xamarin Forms had not been updated. SAME error… so could probably be related to Android 9 and/or Visual Studio 2019

One thing I noticed is the referenced libraries under the Android project seem not to be found:
image
The message when hovering the library is “Assembly not found for Framework Xamarin.Android.v9.0 Support”. I suppose this could indicate that there needs to be a slightly different setup for Android projects under Xamarin using Couchbase Lite???

I include the code for reference (could not fit into the original post):

namespace cb2.Services
{
    public class DbDataStore : IDataStore<Item>
    {
        List<Item> items;
        Database database = null;
        Replicator replicator = null;
        System.Diagnostics.Stopwatch replWatch = null;
        long lastReplMs = 0;
        ulong docCount = 0;
        ulong replTotalCount = 0;
        ulong replProgressCount = 0;
        long replProgressMs = 0;

        public DbDataStore()
        {
            Console.WriteLine("Instantiate " + this);
            items = new List<Item>();

            // Init DB
            if (null == database)
            {
				Database.Log.Console.Level = LogLevel.Info;
                database = new Database("testdb");
				docCount = database.Count;
                Console.WriteLine("Database '{0}' " + (docCount == 0 ? "created" : "opened ({1} docs)"), database.Name, docCount);
            }
            // Init Replication
            if (null == replicator)
            {
                var targetEndpoint = new URLEndpoint(new Uri("ws://ds9.dalsgaard-data.dk:4984/data"));
                var replConfig = new ReplicatorConfiguration(database, targetEndpoint);

                // Add authentication
				string USER = "anonymous";
                string PASSWORD = "xxxxxxxxxxx";
				Console.WriteLine("Log in with user: " + USER);
                replConfig.Authenticator = new BasicAuthenticator(USER, PASSWORD);
                replConfig.Continuous = true;
                replConfig.ReplicatorType = ReplicatorType.PushAndPull;

                // Create replicator
                replicator = new Replicator(replConfig);
                replicator.AddChangeListener(OnReplicationEvent);
                replicator.ResetCheckpoint();
                try
                {
                    Console.WriteLine("Try to start the replicator...");
					var token = replicator.AddDocumentReplicationListener((sender, args) =>
					{
						var direction = args.IsPush ? "Push" : "Pull";
						Console.WriteLine($"Replication type :: {direction}");
						foreach (var document in args.Documents) {
							if (document.Error != null) {
								Console.WriteLine($"Doc ID :: {document.Id}");
								if (document.Flags.HasFlag(DocumentFlags.Deleted)) {
									Console.WriteLine("Successfully replicated a deleted document");
								} else {
									// There was an error
								}
							}
						}
					});
					replicator.Start();
                }
                catch (Exception ex)
                {
                    Console.WriteLine("ERROR: " + ex.ToString());
                }
            }
        }

        void OnReplicationEvent(object sender, ReplicatorStatusChangedEventArgs arg)
        {
            {
                if (arg.Status.Activity == ReplicatorActivityLevel.Busy)
                {
                    startReplTimer();
                    Console.WriteLine("Replication: Busy transferring data");
                }
                if (arg.Status.Activity == ReplicatorActivityLevel.Connecting)
                {
                    startReplTimer();
                    Console.WriteLine("Replication: Connecting to Sync.Gateway");
                }
                if (arg.Status.Activity == ReplicatorActivityLevel.Idle)
                {
                    replTotalCount = arg.Status.Progress.Total;
                    replProgressCount = arg.Status.Progress.Completed;
                    stopReplTimer(replTotalCount > 0);
                    Console.WriteLine("Replication: Idle. Total=" + replTotalCount + ", completed=" + replProgressCount);
                    if (replTotalCount > 0)
                    {     // Only refresh if any thing replicated...
                        docCount = database.Count;
                        Console.WriteLine(" -> send message to reload!");
                        MessagingCenter.Send(this, "Replicate", replTotalCount);
                    }
                    replTotalCount = 0;
                    replProgressCount = 0;
                }
                if (arg.Status.Activity == ReplicatorActivityLevel.Offline)
                {
                    stopReplTimer(arg.Status.Progress.Total > 0);
                    Console.WriteLine("Replication: Offline");
                }
                if (arg.Status.Activity == ReplicatorActivityLevel.Stopped)
                {
                    stopReplTimer(arg.Status.Progress.Total > 0);
                    Console.WriteLine("Replication: Stopped");
                }
                Console.WriteLine($"Replication status: {arg.Status.Progress} - activity: {arg.Status.Activity}. Completed: {arg.Status.Progress.Completed} of {arg.Status.Progress.Total}");
                if (arg.Status.Error != null)
                {
                    Console.WriteLine($"Error :: {arg.Status.Error}");
                }
            }
        }

        private void startReplTimer()
        {
            // Can start in different ways - this will only start if not started
            if (null == replWatch)
            {
                Console.WriteLine("Start replication timer...");
                replWatch = System.Diagnostics.Stopwatch.StartNew();
            }
        }

        private void stopReplTimer(Boolean updateLastTime)
        {
            if (null != replWatch)
            {
                replWatch.Stop();
                if (updateLastTime)
                {
                    lastReplMs = replWatch.ElapsedMilliseconds;
                    Console.WriteLine("Stopped replication timer. Time=" + lastReplMs);
                }
                else
                {
                    Console.WriteLine("Stopped replication timer.");
                }
                replWatch = null;
            }
        }

        public async Task<bool> AddItemAsync(Item item)
        {
            items.Add(item);
            return await Task.FromResult(true);
        }

        public async Task<bool> UpdateItemAsync(Item item)
        {
            var oldItem = items.Where((Item arg) => arg.Id == item.Id).FirstOrDefault();
            items.Remove(oldItem);
            items.Add(item);
            return await Task.FromResult(true);
        }

        public async Task<bool> DeleteItemAsync(string id)
        {
            var oldItem = items.Where((Item arg) => arg.Id == id).FirstOrDefault();
            items.Remove(oldItem);
            return await Task.FromResult(true);
        }

        public async Task<Item> GetItemAsync(string id)
        {
            return await Task.FromResult(items.FirstOrDefault(s => s.Id == id));
        }

        public async Task<IEnumerable<Item>> GetItemsAsync(bool forceRefresh = false)
        {
            items = new List<Item>();
            if (docCount == 0)
            {
                String desc = replTotalCount == 0 ? "" : $"Replicating: { replProgressCount} of { replTotalCount} docs...";
                Console.WriteLine($"New database: - " + desc);
                items.Add(new Item { Id = "All", Text = "- new database -", Description = desc });
                return await Task.FromResult(items);
            }
            var watch = System.Diagnostics.Stopwatch.StartNew();
            // SELECT type, count(1) as count from data where type is valued group by type order by type
            using (var query = QueryBuilder.Select(
                    SelectResult.Property("type"),
                    SelectResult.Expression(Function.Count(Expression.All())).As("count"))
                   .From(DataSource.Database(database))
                   .Where(Expression.Not(Expression.Property("type").IsNullOrMissing()))
                   .GroupBy(Expression.Property("type"))
                   .OrderBy(Ordering.Property("type").Ascending()))
            {
                foreach (var result in query.Execute())
                {
                    Console.WriteLine($"{result.GetString("type")}: {result.GetInt("count")}");
                    items.Add(new Item { Id = result.GetString("type"), Text = result.GetString("type"), Description = "Count: " + result.GetInt("count") });
                }
            }
            long elapsedMs = 0;
            // SELECT count(1) as count from data
            using (var query = QueryBuilder.Select(
                    SelectResult.Expression(Function.Count(Expression.All())).As("count"))
                   .From(DataSource.Database(database)))
            {
                foreach (var result in query.Execute())
                {
                    watch.Stop();
                    elapsedMs = watch.ElapsedMilliseconds;
                    String desc = $"Count: { result.GetInt("count")}, query time: {elapsedMs} ms" + (lastReplMs == 0 ? "" : $", last repl. time {lastReplMs} ms");
                    Console.WriteLine($"All docs: - " + desc);
                    items.Add(new Item { Id = "All", Text = "- all documents -", Description = desc });
                    break;
                }
            }
            //Console.WriteLine($"Query took {elapsedMs} ms");
            return await Task.FromResult(items);
        }
    }
}

… found out by further investigation that the “Assembly not found…” error is a known error in Visual Studio 2019: https://developercommunity.visualstudio.com/content/problem/514955/lost-net-assemblies-after-vs-update.html

The fix mentioned here removes the error in the references - but not in replication code…

The error looks more or less the same (here is the last part - order is slightly different):

: 
:  
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '__Internal'.
[Mono] DllImport loaded library '(null)'.
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'CreateNLSocket'.
[Mono] Probing 'CreateNLSocket'.
[Mono] Found as 'CreateNLSocket'.
Thread started: <Thread Pool> #9
[] * Assertion at /Users/builder/jenkins/workspace/xamarin-android-d16-0/xamarin-android/external/mono/mono/metadata/threadpool-io.c:368, condition `fd >= 0' not met
[libc] Fatal signal 6 (SIGABRT), code -6 in tid 6879 (Thread Pool I/O), pid 6822 (marin.Couchbase)
[zygote64] Do partial code cache collection, code=49KB, data=57KB
[zygote64] After code cache collection, code=49KB, data=57KB
[zygote64] Increasing code cache capacity to 256KB
[zygote64] Compiler allocated 7MB to compile void android.widget.TextView.<init>(android.content.Context, android.util.AttributeSet, int, int)

The whole fd >= 0 assertion is an obnoxious bug that pops up every now and again in Xamarin’s runtime. There is nothing we can do about it, so I suggest filing an issue with them and try using a different version of Xamarin Android to build with.

Ok, thanks. Just noticed when testing that it only happened if I started replication. If I don’t do that then the app runs fine with the previously replicated data (from before the various upgrades). That’s why I put it here :slight_smile:

I’ll try to go through Xamarin. Thanks!

Just out of curiosity, can you create a sample app with Xamarin that can replicate with a Sync. Gateway server?

I have tried more than once - and it breaks every time. I would think that if this is a general problem you would be in a much better situation to provide some more feedback than I am. I can only say that I use that NuGet package and run some of your code :slight_smile:

If this is a general problem (as you indicate) I would guess it would hit many more developers using Couchbase Lite. I have tried my samples again after upgrading to the latest VS 2019. This is my installation:

Visual Studio Professional 2019 for Mac
Version 8.0.6 (build 4)
Installation UUID: 0e93c0c9-35a7-4964-a385-abee678b36e8
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 5.6.0.2 (d16-0 / 040682909)

	Package version: 518010003

Mono Framework MDK
Runtime:
	Mono 5.18.1.3 (2018-08/fdb26b0a445) (64-bit)
	Package version: 518010003

NuGet
Version: 4.8.2.5835

.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	2.1.9
	2.1.8
	2.1.7
	2.1.3
	2.1.2
	2.1.1
	2.0.5
SDK: /usr/local/share/dotnet/sdk/2.1.505/Sdks
SDK Versions:
	2.1.505
	2.1.504
	2.1.503
	2.1.401
	2.1.302
	2.1.301
	2.1.4
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Sdks

Hey @jda

This example app does SG syncing…

Hi @blake.meike

Thanks for the link. Have you tried running it on an Android device from Visual Studio 2019 on Mac? I can see that the repo is around a year old…

Because that is my problem. It started after upgrading everything (VS 2019, Couchbase Lite 2.5, etc. etc.). So I really want to know if someone else can do this? If they can then something is wrong in my app - and I have a chance to fix it. If not then this is a general problem that (in my opinion) is best driven by someone at Couchbase that can provide much better input to the Xamarin/Visual Studio folks.

Hi @jda,

I think it should not be a problem running Xamarin Android from VS2019 on Mac.

I believe our product team has update the Lite API version 2.5 and ran it successfully. (12 days ago)

Please let me know if that’s not the case and I will look into it. PS. I haven’t run any of our sample app using VS2019 though. I am using VS2017.

ALSO: Here is the Tutorial: https://docs.couchbase.com/tutorials/mobile-travel-sample/introduction.html

-Sandy

@Sandy_Chuang thanks. I’ll give it a try and set that sample up.

If it works then it’s a problem with my code - and then I can fix it. I’ll let you know how it goes.

Hi Sandy

First, thank you very much for the links to the tutorial and sample app. They are VERY GOOD!!!

Much, much better than the original samples I started with on 2.0. So again THANK YOU!

So now I’ve spent the entire day hacking around with my app and your travel-sample. It works in my environment so that is a good start. And finally I have come across some steps to reproduce the problem - and I’m not entirely sure why and what the solution is. But let me show the steps:

In the Android project under Build / Android Build / Advanced select arm64-v8a and x86_64 as supported ABIs

Then run the project on an Android device (I have a Nexus 5 running Android 8.1). As soon as it starts to replicate it will crash with this output:

[Mono] Assembly Ref addref SimpleInjector[0x7151b8a500] -> System.Globalization[0x713f696b80]: 4
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] Loading reference 13 of /storage/emulated/0/Android/data/dk.dalsgaarddata.TravelSample/files/.__override__/Xamarin.Forms.Platform.Android.dll asmctx DEFAULT, looking for Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
[Mono] Assembly Ref addref Xamarin.Forms.Platform.Android[0x7151b3d080] -> Xamarin.Android.Support.Compat[0x7151b8ab80]: 4
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'CreateNLSocket'.
[Mono] Probing 'CreateNLSocket'.
[Mono] Found as 'CreateNLSocket'.
Thread started: <Thread Pool> #10
[] * Assertion at /Users/builder/jenkins/workspace/xamarin-android-d16-0/xamarin-android/external/mono/mono/metadata/threadpool-io.c:368, condition `fd >= 0' not met
[libc] Fatal signal 6 (SIGABRT), code -6 in tid 6024 (Thread Pool I/O), pid 5628 (ta.TravelSample)

Now, if I go back in and deselect the two ABIs I had selected and try to run the project again it now fails with:

[zygote] Late-enabling -Xcheck:jni
[zygote] Attempt to remove non-JNI local reference, dumping thread
[zygote] Attempt to remove non-JNI local reference, dumping thread
[monodroid] Creating public update directory: `/data/user/0/dk.dalsgaarddata.TravelSample/files/.__override__`
[monodroid] Using override path: /data/user/0/dk.dalsgaarddata.TravelSample/files/.__override__
[monodroid] Using override path: /storage/emulated/0/Android/data/dk.dalsgaarddata.TravelSample/files/.__override__
[monodroid] Using runtime path: /data/app/Mono.Android.DebugRuntime-8-Y0fUi9l4B9zV20-L2IpQ==/lib/arm64
[monodroid] checking directory: `/data/user/0/dk.dalsgaarddata.TravelSample/files/.__override__/lib`
[monodroid] directory does not exist: `/data/user/0/dk.dalsgaarddata.TravelSample/files/.__override__/lib`
[monodroid] checking directory: `/storage/emulated/0/Android/data/dk.dalsgaarddata.TravelSample/files/.__override__/lib`
[monodroid] checking file: `.`
[monodroid] checking file: `..`
[monodroid] checking directory: `/storage/emulated/0/../legacy/Android/data/dk.dalsgaarddata.TravelSample/files/.__override__/lib`
[monodroid] directory does not exist: `/storage/emulated/0/../legacy/Android/data/dk.dalsgaarddata.TravelSample/files/.__override__/lib`
[monodroid] Trying to load sgen from: /data/user/0/dk.dalsgaarddata.TravelSample/files/.__override__/libmonosgen-2.0.so
[monodroid] Trying to load sgen from: /storage/emulated/0/Android/data/dk.dalsgaarddata.TravelSample/files/.__override__/libmonosgen-2.0.so
[monodroid] Trying to load sgen from: /storage/emulated/0/../legacy/Android/data/dk.dalsgaarddata.TravelSample/files/.__override__/libmonosgen-2.0.so
[monodroid] Trying to load sgen from: /data/app/dk.dalsgaarddata.TravelSample-BX2FevFgEg-oHJL_aOXyZA==/lib/arm/libmonosgen-2.0.so
[monodroid] Trying to load sgen from: /data/user/0/dk.dalsgaarddata.TravelSample/files/.__override__/links/libmonosgen-2.0.so
[monodroid] shared runtime initialization error: dlopen failed: "/data/app/Mono.Android.DebugRuntime-8-Y0fUi9l4B9zV20-L2IpQ==/lib/arm64/libmonosgen-64bit-2.0.so" is 64-bit instead of 32-bit

… and I can’t really go back to making it work. :frowning_face:

I have also tried to change the default http handler to a “better choice” - but that seems not to be the reason and have no impact.

Does this make sense to you? And perhaps more importantly, do you know a “safe” way to avoid this problem?

As far as I understand the development from Apple and Google then we should really compile the code for 64bit.

Thanks in advance for any light you can shed on this :wink:

/John

Please try un-installing the app, making sure that the ABI arm64 is selected (you can select others as well, but you need arm64), rebuilding and re-installing.
Be sure to completely un-install the app, first!

Thanks for the suggestion. I think I had already tried that a few times, but this is what I just did:

  1. selected arm64-v8a as ABI - and de-selected all others
  2. deleted the app on the physical phone
  3. cleaned all projects
  4. ran the app on the physical device

… the app crashed.

I did this for your demo app as well as my app.

Yes!!. That is because a Nexus 5 does not support arm64!!

You need to select at least armabi.

Ah, Ok. I didn’t know.

I added armeabi-v7a, deleted the app, cleaned the entire project and re-ran…

Still crashes.

… are you sure about this?

The app actually launches - it doesn’t break until it starts replicating…

I am not sure that this is the only problem, but I am quite sure that a Nexux 5 is not 64 bit. You want armabi.

The app won’t crash until it needs to load the native library.

Ok, thanks.

A warning - this is rather long, but I wrote it for everybody else to be able to follow the steps and the final solution :slight_smile:

I tried to go back to a fresh “untouched” copy of your sample app (I had also tried to change to the Community edition of Couchbase Lite as this is what I use in my project). Restored NuGet packages and tried to run it (in VS2019 on Mac). First, I get this error:

So I had to go into the project and disable armabi (and then it disappears as it no longer exists). The other 32 bit options were already selected:

image

Everything is working Ok (after having adjusted url’s to hit the computer with the servers).

Then I tried to add support for the other ABIs:

image

Uninstalled the app on the device, cleaned all projects, run on the device - and now it crashes. The app.log shows:

[Mono] Loading reference 1 of System.Net.Http.dll asmctx DEFAULT, looking for System, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e
[Mono] Assembly Ref addref System.Net.Http[0x7bb8df7a00] -> System[0x7bcc339580]: 14
[Mono] Loading reference 7 of /storage/emulated/0/Android/data/com.companyname.TravelSample/files/.__override__/TravelSample.Core.dll asmctx DEFAULT, looking for System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
[Mono] Unloading image System.Runtime.dll [0x7bb9d56000].
[Mono] Image addref System.Runtime[0x7bb4105b80] (asmctx DEFAULT) -> System.Runtime.dll[0x7bba933800]: 9
[Mono] Config attempting to parse: 'System.Runtime.dll.config'.
[Mono] Config attempting to parse: '/Users/builder/jenkins/workspace/xamarin-android-d16-0/xamarin-android/external/mono/sdks/out/android-arm64-v8a-release/etc/mono/assemblies/System.Runtime/System.Runtime.config'.
[Mono] Assembly Ref addref TravelSample.Core[0x7bcc382680] -> System.Runtime[0x7bba9d6600]: 7
[Mono] Loading reference 8 of /storage/emulated/0/Android/data/com.companyname.TravelSample/files/.__override__/TravelSample.Core.dll asmctx DEFAULT, looking for mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
[Mono] The request to load the assembly mscorlib v4.0.0.0 was remapped to v2.0.5.0
[Mono] Unloading image mscorlib.dll [0x7bb9d56000].
[Mono] Config attempting to parse: 'mscorlib.dll.config'.
[Mono] Config attempting to parse: '/Users/builder/jenkins/workspace/xamarin-android-d16-0/xamarin-android/external/mono/sdks/out/android-arm64-v8a-release/etc/mono/assemblies/mscorlib/mscorlib.config'.
[Mono] Assembly Ref addref TravelSample.Core[0x7bcc382680] -> mscorlib[0x7bcc2f3180]: 56
[Mono] Loading reference 9 of /storage/emulated/0/Android/data/com.companyname.TravelSample/files/.__override__/TravelSample.Core.dll asmctx DEFAULT, looking for System.ComponentModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
[Mono] Assembly Ref addref TravelSample.Core[0x7bcc382680] -> System.ComponentModel[0x7bba424800]: 5
PushPull Replicator: 0/0, error <none>, activity = Connecting
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_FromData'.
[Mono] Probing 'FLValue_FromData'.
[Mono] Found as 'FLValue_FromData'.
Thread finished:  #13
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_GetType'.
[Mono] Probing 'FLValue_GetType'.
[Mono] Found as 'FLValue_GetType'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_AsDict'.
[Mono] Probing 'FLValue_AsDict'.
[Mono] Found as 'FLValue_AsDict'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLDict_Count'.
[Mono] Probing 'FLDict_Count'.
[Mono] Found as 'FLDict_Count'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLDictIterator_Begin'.
[Mono] Probing 'FLDictIterator_Begin'.
[Mono] Found as 'FLDictIterator_Begin'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLDictIterator_GetKey'.
[Mono] Probing 'FLDictIterator_GetKey'.
[Mono] Found as 'FLDictIterator_GetKey'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_AsString'.
[Mono] Probing 'FLValue_AsString'.
[Mono] Found as 'FLValue_AsString'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLDictIterator_GetValue'.
[Mono] Probing 'FLDictIterator_GetValue'.
[Mono] Found as 'FLDictIterator_GetValue'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLDictIterator_Next'.
[Mono] Probing 'FLDictIterator_Next'.
[Mono] Found as 'FLDictIterator_Next'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLValue_AsArray'.
[Mono] Probing 'FLValue_AsArray'.
[Mono] Found as 'FLValue_AsArray'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLArray_Count'.
[Mono] Probing 'FLArray_Count'.
[Mono] Found as 'FLArray_Count'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLArrayIterator_Begin'.
[Mono] Probing 'FLArrayIterator_Begin'.
[Mono] Found as 'FLArrayIterator_Begin'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLArrayIterator_GetValue'.
[Mono] Probing 'FLArrayIterator_GetValue'.
[Mono] Found as 'FLArrayIterator_GetValue'.
[Mono] DllImport searching in: 'LiteCore' ('libLiteCore.so').
[Mono] Searching for 'FLArrayIterator_Next'.
[Mono] Probing 'FLArrayIterator_Next'.
[Mono] Found as 'FLArrayIterator_Next'.
[Mono] Loading reference 13 of /storage/emulated/0/Android/data/com.companyname.TravelSample/files/.__override__/Xamarin.Forms.Platform.Android.dll asmctx DEFAULT, looking for Xamarin.Android.Support.Compat, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
[Mono] Assembly Ref addref Xamarin.Forms.Platform.Android[0x7bcc339000] -> Xamarin.Android.Support.Compat[0x7bcc382b00]: 4
[Mono] Loading reference 11 of /storage/emulated/0/Android/data/com.companyname.TravelSample/files/.__override__/SimpleInjector.dll asmctx DEFAULT, looking for System.Globalization, Version=4.0.10.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
[Mono] Assembly Ref addref SimpleInjector[0x7bcc382480] -> System.Globalization[0x7bb9cc3b00]: 4
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation': 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/CoreFoundation.framework/libCoreFoundation" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport attempting to load: '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration.so" not found'.
[Mono] DllImport error loading library '/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration': 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport unable to load library 'dlopen failed: library "/System/Library/Frameworks/SystemConfiguration.framework/libSystemConfiguration" not found'.
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'CreateNLSocket'.
[Mono] Probing 'CreateNLSocket'.
[Mono] Found as 'CreateNLSocket'.
[Choreographer] Skipped 68 frames!  The application may be doing too much work on its main thread.
Thread started: <Thread Pool> #14
[] * Assertion at /Users/builder/jenkins/workspace/xamarin-android-d16-0/xamarin-android/external/mono/mono/metadata/threadpool-io.c:368, condition `fd >= 0' not met
[libc] Fatal signal 6 (SIGABRT), code -6 in tid 21032 (Thread Pool I/O), pid 20903 (me.TravelSample)

Perhaps this is not supposed to work? So, Ok, I go back to the options of the Android project, and untick the two 64 bit ABIs (as in the first change), uninstall the app on the device, clean all projects, run on the device - and this works!

Looking at the Android project I see that Couchbase Lite has an update available (2.5.0) - and the core project is already using 2.5.0:

So I updated both the core project and the android project to version 2.5.0 of the Community version. And… it works!

Looking at the details I discover one difference from my tests yesterday. I have not included the Couchbase.Lite.Support.Android library - I think I just thought that the Couchbase.Lite package would pull it in as a dependency… - but it is not there.

Sooo…, I added the support library to my own (failing) project from yesterday - and now that also works!! - and I can continue my work :slight_smile:

Apparently, I don’t have to add the support library to my iOS project - and it isn’t mentioned in the documentation. That would have helped :wink:

Thanks for your patience and support!

Awesome analysis @jda! Thank you very much!

I’m an Android guy, so I don’t know the toolchain your are dealing with, very well. I will pass this on to my colleagues who have more experience with it and we will see if we can’t at least do something about the documentation.

1 Like

Thanks for spending the time to explain this, but can you please summarize in brief what worked for you in the end? It is still not clear to me from your explanation if you have managed to use arm64-v8a with Android 9. You write that you “untick the two 64 bit ABIs” and it then works. But have you managed to make it work with the 64 bit ABIs, or not?

I have not been able to do that, I still get the “condition `fd >= 0’ not met” error. I had to remove arm64 when I started using Android 9, thinking that this was something temporary with a fix coming up shortly, either by Xamarin or by Couchbase, but now I understand that the situation is more complicated than I thought. I’ve tried both Couchbase.lite 2.1.5 and 2.5.0, and I get the error on two different development machines.