-
Notifications
You must be signed in to change notification settings - Fork 157
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
Couldn't determine a writable folder where to store realm file. Specify absolute path manually. #1532
Comments
Are you getting the crash in your main application or your share extension? Currently, Realm Xamarin doesn't support share extensions due to #1354. |
It's in the main application. |
I haven't been able to reproduce it on my iPad. Can you try to clear your bin/obj folders and/or adding the realm nugets again? |
Yeah, problem still persists. Even building in a complete clean installed virtual machine doesn't fix it. |
Sorry for the delay - I slightly modified your build environment which is why I didn't manage to reproduce it the first time. Looking at it again, the problem is that Realm is using Reflection to find the documents folder (this API is not available for .NET Standard). However, because on device you have enabled the linker, it strips the [Preserve(AllMembers = true)]
static class Preserver
{
static void EnsurePreserved()
{
Environment.GetFolderPath(Environment.SpecialFolder.Personal);
}
} Let me know if that works for you and apologies again for not realizing this sooner. |
Works, thank you! ❤️ |
Glad to hear that! If you face other issues, don't hesitate to reach out :) |
Goals
Trying to create an realm instance on an iOS device using realm-dotnet
Expected Results
Getting a realm instance
Actual Results
Steps to Reproduce
This just crashes on real hardware, simulator is working fine. Just try to create a new
Realm.GetInstance()
and deploy the application to an iOS device.Code Sample
https://github.com/Schaefers/realm-share-extension (will be updated in a few minutes)
Version of Realm and Tooling
The text was updated successfully, but these errors were encountered: