-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Library does not create the db-file for SQLite on MacOS #108
Comments
hmmmmmmmm @praeclarum any thoughts on this? this is all I am doing: https://github.com/jamesmontemagno/monkey-cache/blob/master/src/MonkeyCache.SQLite/Barrel.cs#L48 |
Are you debugging it locally on your machine? you may need to give your app disk access perhaps, it would probably be different in release. I will test out though. |
I am debugging it locally, yes. I am using the Xamarin.Essentials.FileSystem API to get the AppDataDirectory for my cache both on iOS and MacOS. I also use the same Bundle Identifier on both platform (which shouldn't cause a problem, right?). I haven't activated the sandbox for my app yet because I am only in the beginning of my Mac application journey... |
It is also reproducable - here is a minimum sample . I just created a new XF app with just iOS. Then added the MacOS project and followed the docs Then I added the MonkeyCache SQLite package and finally, doing the same I am doing in my original app. Hope this helps to find the problem. |
awesome! thanks for the repro, i will take a look |
I just forked your repo and added a MacOS test project to investigate the issue further. With this, I was able to extract the full stack trace for the error:
Searching for the error message leads me to several Mac specific issues in the sqlite.net repo Even if it doesn't feel right, following this recommendation leads to the test app at least starting up. (Haven't followed the road further until now, just leaving this crumbs here). Hope this helps in the meantime. |
Odd as I know for sure frank uses sqlite-net in his mac apps.... Got it so it seems like you had to manually add that reference hmmmmm |
You both are talking about sqlite-net often enough ;-) If it was my lib, I would just include in the project file as Mac specific package. Just to save others some time. On the other hand, I am not sure how this turns out on MAUI, which has its own challenges (at least for now). |
The problem is still present with .NET MAUI... |
As I was able to use the SQLite provider with the main library in my Xamarin.Forms iOS app, I tried to use it in the additional Mac app as well.
It creates the MonkeyCache folder in the folder I specify, but does not create the db file(s). I tried several folders on my Mac without success.
If I try to access Barrel.Current, I get this:
System.TypeInitializationException: The type initializer for 'SQLite.SQLiteConnection' threw an exception.
I am running out of ideas why this is happening with the latest version of the package and MacOS Monterey.
Any hint how to get around this would me helpful.
The text was updated successfully, but these errors were encountered: