paint-brush
Reactive Extensions for .NET in an iOS share extensionby@zbrianw

Reactive Extensions for .NET in an iOS share extension

by Brian WOctober 20th, 2017
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

One of the applications we’re building makes use of Reactive Extensions for .NET in an iOS share extension.

Company Mentioned

Mention Thumbnail
featured image - Reactive Extensions for .NET in an iOS share extension
Brian W HackerNoon profile picture

One of the applications we’re building makes use of Reactive Extensions for .NET in an iOS share extension.

We had encountered the share extension closing when being run on a real device rather than it working as it did when run via the iOS simulator. The error was: “error: Failed to load AOT module ‘/private/var/containers/Bundle/Application/{id}/{app}/System.Reactive.PlatformServices.dll.so’ in aot-only mode.”

The first step was to diagnose if the linker was removing the reference, so I tried setting the Linker Behavior to “Don’t Link” in the share extension project and in the container application project. Clean and rebuild. The same error occurred.

After much fiddling, the accidental discovery that by adding: System.Reactive.PlatformServices.EnlightenmentProvider.EnsureLoaded(); allowed the share extension to load and run on the actual device. The summary describes it best:

EnlightmentProvider [from metadata]

Thought I would put the notes up somewhere for the next time I search for “System.Reactive.PlatformServices.dll.so’ in aot-only mode.” which I didn’t have much luck with this past week ;)