Uploaded image for project: 'Realm .NET SDK'
  1. Realm .NET SDK
  2. RNET-1157

TypeInitializationException on initialization

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: None

      What happened?

      Trying to init realm launching the app on ios simulator using:
      var config = new RealmConfiguration("AAA0aAB8AAA3NDUzZmM1ZGY0YmEwMDY5MjExAAA5")

      { SchemaVersion = RealmVersion, ShouldDeleteIfMigrationNeeded = true };
      await Realm.GetInstanceAsync(config);

      Getting an exception:
      System.TypeInitializationException: The type initializer for 'Realms.SharedRealmHandle' threw an exception.

      h3. Repro steps
      # await Realm.GetInstanceAsync(config);
      # Crash

      h3. Version
      .NET 8, iOS Simulator 17.2, Mac M1 chip, Sonoma 14.1.2 (23B92)

      h3. What Atlas Services are you using?
      Local Database only

      h3. What type of application is this?
      Xamarin

      h3. Client OS and version
      iOS simulator 17.2 Realm 12.2

      h3. Code snippets
      var config = new RealmConfiguration("AAA0aAB8AAA3NDUzZmM1ZGY0YmEwMDY5MjExAAA5")
      { SchemaVersion = RealmVersion, ShouldDeleteIfMigrationNeeded = true }

      ;
      await Realm.GetInstanceAsync(config);

      Stacktrace of the exception/crash you're getting

      Unable to find source-code formatter for language: shell. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      System.TypeInitializationException: The type initializer for 'Realms.SharedRealmHandle' threw an exception.
       ---> System.EntryPointNotFoundException: realm_syncuser_install_callbacks
         at Realms.Sync.SyncUserHandle.Initialize()
         at Realms.NativeCommon.Initialize()
         at Realms.SharedRealmHandle..cctor()
         --- End of inner exception stack trace ---
         at Realms.RealmConfiguration.CreateHandle(Configuration& configuration)
         at Realms.RealmConfiguration.<>c__DisplayClass29_0.<CreateHandleAsync>b__0()
         at System.Threading.Tasks.Task.InnerInvoke()
         at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj)
         at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object )
      --- End of stack trace from previous location ---
         at Realms.RealmConfiguration.CreateHandle(Configuration& configuration)
         at Realms.RealmConfiguration.<>c__DisplayClass29_0.<CreateHandleAsync>b__1(Task _)
         at System.Threading.Tasks.ContinuationResultTaskFromTask`1[[Realms.SharedRealmHandle, Realm, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null]].InnerInvoke()
         at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj)
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext , ContextCallback , Object )
      --- End of stack trace from previous location ---
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext , ContextCallback , Object )
         at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& , Thread )
      --- End of stack trace from previous location ---
         at Realms.RealmConfigurationBase.CreateRealmAsync(CancellationToken cancellationToken)
         at CTeleport.Mobile.Core.RealmStore.RealmConfigurator.GetRealmInstance(String id) in /Users/alexeyshavrukov/projects/cteleport/mobile/src/CTeleport.Mobile.Core/RealmStore/RealmConfigurator.cs:line 24
         at CTeleport.Mobile.Core.RealmStore.StorageManager.<GetStorage>d__7`1[[CTeleport.Mobile.Core.RealmStore.Models.ISettingsStorage, CTeleport.Mobile.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
         at Realms.RealmConfiguration.CreateHandle(Configuration& configuration)
         at Realms.RealmConfiguration.<>c__DisplayClass29_0.<CreateHandleAsync>b__1(Task _)
         at System.Threading.Tasks.ContinuationResultTaskFromTask`1[[Realms.SharedRealmHandle, Realm, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null]].InnerInvoke()
         at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj)
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext , ContextCallback , Object )
      --- End of stack trace from previous location ---
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext , ContextCallback , Object )
         at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& , Thread )
      --- End of stack trace from previous location ---
         at Realms.RealmConfigurationBase.CreateRealmAsync(CancellationToken cancellationToken)
         at Realms.RealmConfiguration.CreateHandle(Configuration& configuration)
         at Realms.RealmConfiguration.<>c__DisplayClass29_0.<CreateHandleAsync>b__0()
         at System.Threading.Tasks.Task.InnerInvoke()
         at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj)
         at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object )
      --- End of stack trace from previous location ---
         at Realms.RealmConfiguration.CreateHandle(Configuration& configuration)
         at Realms.RealmConfiguration.<>c__DisplayClass29_0.<CreateHandleAsync>b__1(Task _)
         at System.Threading.Tasks.ContinuationResultTaskFromTask`1[[Realms.SharedRealmHandle, Realm, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null]].InnerInvoke()
         at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj)
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext , ContextCallback , Object )
      --- End of stack trace from previous location ---
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext , ContextCallback , Object )
         at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& , Thread )
      --- End of stack trace from previous location ---
         at Realms.RealmConfigurationBase.CreateRealmAsync(CancellationToken cancellationToken)
         at CTeleport.Mobile.Core.RealmStore.RealmConfigurator.GetRealmInstance(String id) in /Users/alexeyshavrukov/projects/cteleport/mobile/src/CTeleport.Mobile.Core/RealmStore/RealmConfigurator.cs:line 24
         at CTeleport.Mobile.Core.RealmStore.StorageManager.<GetStorage>d__7`1[[CTeleport.Mobile.Core.RealmStore.Models.ISettingsStorage, CTeleport.Mobile.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
         at Realms.RealmConfiguration.CreateHandle(Configuration& configuration)
         at Realms.RealmConfiguration.<>c__DisplayClass29_0.<CreateHandleAsync>b__0()
         at System.Threading.Tasks.Task.InnerInvoke()
         at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj)
         at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread , ExecutionContext , ContextCallback , Object )
      --- End of stack trace from previous location ---
         at Realms.RealmConfiguration.CreateHandle(Configuration& configuration)
         at Realms.RealmConfiguration.<>c__DisplayClass29_0.<CreateHandleAsync>b__1(Task _)
         at System.Threading.Tasks.ContinuationResultTaskFromTask`1[[Realms.SharedRealmHandle, Realm, Version=12.2.0.0, Culture=neutral, PublicKeyToken=null]].InnerInvoke()
         at System.Threading.Tasks.Task.<>c.<.cctor>b__281_0(Object obj)
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext , ContextCallback , Object )
      --- End of stack trace from previous location ---
         at System.Threading.ExecutionContext.RunInternal(ExecutionContext , ContextCallback , Object )
         at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& , Thread )
      --- End of stack trace from previous location ---
         at Realms.RealmConfigurationBase.CreateRealmAsync(CancellationToken cancellationToken)
         at CTeleport.Mobile.Core.RealmStore.RealmConfigurator.GetRealmInstance(String id) in /Users/alexeyshavrukov/projects/cteleport/mobile/src/CTeleport.Mobile.Core/RealmStore/RealmConfigurator.cs:line 24
         at CTeleport.Mobile.Core.RealmStore.StorageManager.<GetStorage>d__7`1[[CTeleport.Mobile.Core.RealmStore.Trips.ITripsStorage, CTeleport.Mobile.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
         at CTeleport.Mobile.Core.Services.Archive.BookingArchiveService.GetAllActiveTripsFromStorageAsync() in /Users/alexeyshavrukov/projects/cteleport/mobile/src/CTeleport.Mobile.Core/Services/Archive/BookingArchiveService.cs:line 102
         at CTeleport.Mobile.Core.ViewModels.Archive.ArchiveViewModel.LoadCachedBookings() in /Users/alexeyshavrukov/projects/cteleport/mobile/src/CTeleport.Mobile.Core/ViewModels/Archive/ArchiveViewModel.cs:line 391
      

      Relevant log output

      No response

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: