Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
Mono.Data.Sqlite will throw exceptions that the database is read-only when running on API 21 x86_64 emulators.
**Steps to Reproduce:**
1. Create an Android 5.0 API 21 emulator using the Atom x86_64 (you will need Intel HAXM installed)
2. Run the attached sample on that emulator
It will crash with an exception message "Attempt to write a read-only database".
**Build Date & Platform:**
Android 5.0 x86_64
I did not have a device that was 64 bit to test this on. It may not be specific to emulators.
It works on x86 emulators
It works on 32 bit Android 5 devices.
The database file does not appear to be read-only (-rwxrwx--- root sdcard_r 10240 2014-12-02 11:15 DatabaseName.db)
Possible explanation: http://stackoverflow.com/a/27013698
The SO article points to a bug report for the issue being in Sqlite: https://code.google.com/p/android/issues/detail?id=79994
This appears to be an Android bug, in that 32-bit processes running on 64-bit targets can't access external directories: