As the title says I am wanting to share a Sqlite database between an Android app written in Java and one written in C# using Xamarin. I can successfully share a database between two Java apps (With the help of this question) but when I try the same thing in Xamarin I am getting the following error:
Android.Database.Sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
"C:\Users\userName\AppData\Local\Xamarin\Mono for Android\debug.keystore"
Xamarin.Android does not support
SharedUserId via an
ApplicationAttribute. (I guess no one every filed an issue about it)
Add your shared user id via the manifest and it will work fine:
<application android:allowBackup="true" android:sharedUserId="com.sushihangover" android:icon="@mipmap/icon" android:label="@string/app_name"></application>
Note: Make sure that you manually uninstall both apps, add the
sharedUserId, rebuild and reinstall both apps.
Note: Make sure that you are using the same signing certificate for both your Java and Xamarin apps.