Adding some new issues that might help narrow down the problem.
1. When looking at my library on my phone, the lower left corner says "150 entries". When I uploaded the data to the cloud, it said there was a maximum of 149 items (Uploading 8 of 149...etc.)
2. When I open it in the desktop app (after deleting the .memento folder), and choose Download, it says there are 169 entries in the library. But also in the lower left of the desktop app it shows "150 entries". ???
3. Lastly, whenever I edit the library on the desktop, no matter what I click on in the resulting window (the one that shows all the fields of the library), it gives me the "duplicate key" error and crashes. Very frustrating.
At this point, I'm going to try and rebuild the library on the desktop and hope that it rights itself. However, I'd still like help to understand what's going on with the duplicate key issue.