I am not so concerned who is to blame for this, Couchbase, Microsoft, Google. More worried about what happens in August.
To reproduce the issue:
- download the TravelSample app, and set it up as per the tutorial (you need a server for replication)
- I set up a Couchbase Community server and Gateway in Windows 10 and configured as per tutorial, confirmed it worked with the sample Python app
- have to remove the “delta updates” flag from the Gateway JSON config file as this is an Enterprise feature and makes Gateway Community refuse to start
- fixed the log file path in the Gateway JSON config file to conform to Windows 10 environment
- open the TravelSample project file (sln) under dotnet directory in Visual Studio, I use Visual Studio 2019 for Mac, but 2017/2019 Mac/Windows should not matter
- I changed line 41 of LoginModel.cs in TravelSample.Core to replace “localhost” with the IP of my VM hosting Couchbase
- I changed line 35 of Constants.cs in TravelSample.Core to replace “localhost” with the IP of my VM hosting Couchbase
- Since I used Couchbase Community I removed the Couchbase Lite Enterprise NuGet packages from both projects and replaced them with the Couchbase Lite Community packages.
- left all the other NuGets on the version as they came, updating them makes no difference
- open the Options on the TravelSample.Android project, and go to Android Build > Advanced, fix/change to support the ABIs: armeabi-v7a and arm64-v8a.
- on Visual Studio this is project Properties, then Android Options, Advanced, Supported Architectures
- run (debug or release) with the TravelSample.Android project as startup project (default) on a 64-bit capable device (in my case Samsung A8 (2018), latest security pack, Android 9), so the arm64-v8a binary is used.
- log into the app with a valid user (per tutorial: admin / password; what I used)
- will crash as soon as the replication starts
[.] * 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
For comparison, when I go back to the Android project, and remove arm64-v8a (so it’s only armeabi-v7a enabled), rebuild the solution, remove the previous app from the phone, run it again, no crash on replication, sample app works as designed.
My setup is Visual Studio 2019 for Mac, with Xamarin.Android 9.2.3.0. Also tried on Visual Studio 2017 for Mac, with Xamarin.Android 9.1.8.0.
I have also tried the same sample steps on Windows 10 with Visual Studio 2019 and Xamarin.Android 9.3.0.22. Same result:
armeabi-v7a only build replication works
arm64-v8a included build on 64-bit phone crashes when replication starts
05-28 13:36:24.862 F/ ( 9749): * Assertion at /Users/builder/jenkins/workspace/xamarin-android-d16-1/xamarin-android/external/mono/mono/metadata/threadpool-io.c:368, condition `fd >= 0’ not met
If you filed a report please let us know. Since Xamarin is open source, have you considered debugging Xamarin.Android to see why it crashes for Couchbase Lite? And if not, for any reason other than the time it would take to set up and do?