I cannot get a Maui.net app to initialize the realm for IOS. it works fine on windows and android, but not IOS.
for troubleshooting purposes, I installed the .net “todo” example referenced in the Setup tutorial.
It is hanging up at the same location and giving the same error.
I’m using Realm 11.5 (li even tried older versions)
target platform is net7.0 for all platforms.
I’ve tried deleting the bins, cleaning, rebuilding, etc…
during debugging it seems the problem is
Snippet
app = Realms.Sync.App.Create(appConfiguration);
this line of code throws an exception(only on IOS)
“The type initializer for ‘Realms.Sync.AppHandle’ threw an exception.”
my output window shows the following
…
[0:] An error occurred: ‘realm-wrappers’. Callstack: ’ at Realms.SynchronizationContextScheduler.Initialize()
at Realms.NativeCommon.Initialize()
at Realms.Sync.AppHandle…cctor()’
2023-10-02 14:17:04.275 Xamarin.PreBuilt.iOS[1766:1382615] Warning: observer object was not disposed manually with Dispose()…
The is from the unmodified “todo” app (except the config file reflects app id)
it works perfect for windows and android.
I’m developing on windows (visual studios 2022 ver 17.6.5)
the mac connected is using Ventura 13.5.2
Xcode is ver 15.0
IOS ver is 16.7 on Iphone Xr (i also tried on older phone with ver 15.7.9)
I am using real device.
The app runs and deploys if I remark out the code