Xamarin.iOS

Mono TLS Deprecation: This version of Xamarin.iOS (C9) is the last one to ship with the optional Mono (managed) SSL/TLS provider. This old provider only supports the SSLv3 and TLSv1 standards, which several servers don't support anymore. Support for the newer TLSv1.1 and 1.2 is only available using the newer AppleTLS provider. This new provider is already used, by default, when building applications (since XI 9.8 / C7).
MSBuild IPA Changes: This version of Xamarin.iOS (C9) no longer outputs `*.ipa` files in a timestamped directory located under the directory defined by the `OutputPath` MSBuild variable by default. Instead, the default behavior has changed such that the `*.ipa` file will be created as an *immediate child* of the directory defined by the `OutputPath` MSBuild variable. The `IpaPackagePath` MSBuild variable will still be defined by the build process and so it is expected that CI and other build scripts that properly use this variable to locate the `*.ipa` file generated by the build will continue to work as expected. Also of note is that the `Clean` target will now delete the `*.ipa` file created during the build.

Requirements

  • The latest features and API requires Xcode 8.2 and the bundled iOS, tvOS and watchOS SDKs;
  • Apple Xcode 8.2 requires a Mac running OSX 10.11.5 (El Capitan) or newer;

What's New

This release is built upon our open sourced SDK, using the cycle9 branch, and based on Mono 4.8.0.

watchOS stable support

This version introduces stable support for native watchOS 2+ applications.

One of multiple improvements we've done is to reduce the size of incremental debug builds significantly, by not including unnecessary bitcode in the generated binaries (since bitcode is only required when shipping apps to the App Store). This change reduces the watch app size (of debug builds with incremental builds enabled) by at least 25MB, which results in drastically faster deploy times.

Updating from previews (XI 10.0 - 3)

The older, preview templates and tooling used a exe for the watch extension. This has changed to be a library, .dll. To upgrade an existing project you can:

  • Edit your project options: Build > General > Compile Target, change Executable to Library; or
  • Edit your .csproj file to change <OutputType>Exe</OutputType> to <OutputType>Library</OutputType>; or
  • Create a new project, using the new template, and copy your code inside it;

watchOS managed API

Due to the limited native API available on watchOS, the managed networking stack is not available. This means that the following managed API will throw PlatformNotSupportedException:

System assembly
  • System.Net.AuthenticationManager
  • System.Net.ServicePoint
  • System.Net.ServicePointManager
  • System.Net.Mail.SmtpClient
  • System.Net.Security.SslStream
  • System.Net.Sockets.Socket:Bind
  • System.Net.Sockets.TcpClient
  • System.Net.Sockets.TcpListener
  • System.Net.Sockets.UdpClient
  • System.Net.WebSockets.ClientWebSocket
  • System.Net.Dns:[Begin]GetHostByName
  • System.Net.Dns:[Begin]GetHostEntry
  • System.Net.Dns:[Begin]Resolve
  • System.Net.FtpWebRequest
  • System.Net.FtpWebResponse
  • System.Net.HttpListener
  • System.Net.HttpListenerContext
  • System.Net.HttpListenerPrefixCollection
  • System.Net.HttpListenerRequest
  • System.Net.HttpListenerResponse
  • System.Net.HttpWebRequest
  • System.Net.HttpWebResponse
System.Net.Http assembly
  • System.Net.Http.HttpClientHandler
System.Data assembly
  • System.Data.SqlClient namespace

And the following assemblies are not shipped at all:

  • Mono.Data.Tds.dll
  • Mono.Security.dll

As an alternative you can use

  • any of the native API, e.g. NSUrlSession*; or
  • System.Net.Http.HttpClient which will use the native networking stack through a custom HttpMessageHandler: NSUrlSessionHandler

Additional control on parallel AOT builds

It's now possible to specify how many parallel AOT processes mtouch can launch by using the -j # argument to mtouch (in the project's iOS Build options). The default is the number of processors on the machine, but builds on high-end machines may profit from increasing this value.

New NSUrlSessionHandler implementation

A new implementation of NSUrlSessionHandler was contributed by Nick Berardi. The new version offers the same features as the previous one but requires less memory and, by reusing it, less time spent in the garbage collector;

Xamarin Analysis

We added a new rule to our project analysis tool which ensures that iOS distribution builds do not include TestCloud support. App builds that initialize the Test Cloud agent will be rejected by Apple when submitted, as they use private API.

As a reminder you can run the Xamarin Analysis rules from Xamarin Studio's menu bar by selecting Project > Run Code Analysis.

Other Enhancements

  • String optimizations inside the binding generator, i.e. btouch, makes it 10% faster than previous releases;
  • String optimizations inside the linker resolver, make the partial static registrar about 10% faster than previous releases;
  • Additional caching in the registrar makes it about 4% faster than previous releases;
  • Several fixes to allow the use of msbuild over xbuild;
  • Allow control of LLVM optimization when generating bitcode using --llvm-opt=. Right now only the default -O2 option is supported / tested (10.4.0.96+)

Known Issues

  • 52381 Build error MT0000 with a System.IO.DirectoryNotFoundException
    • Workaround: Clean your solution (not just the main project) after updating XI

Xamarin.iOS 10.4.0

The following documents contains a complete list of the API changes since our latest stable release: XI 10.3.1 (C8SR2)

Bug Fixes

  • 3817 - [foundation] Use more generated code for NSRunLoopMode and add helper API
  • 28817 - [corevideo] Add CVPlanarPixelBufferInfo_YCbCrBiPlanar
  • 32535 - [avfoundation] Add overloads to AVCaptureDevice that accept an enum
  • 34248 - [foundation] Add missing helper properties on NSMetadataItem
  • 34436 - [scenekit] Add overload to SCNRenderer.FromContext that accept a [C|EA]GLContext argument
  • 36109 - [mtouch] Fix check if an assembly is a framework assembly to take into account symlinks
  • 37175 - [foundation] NSUrlSession's Create*Task methods may return a base class of the type the headers claim
  • 40230 - [coregraphics] Add managed validation to CGPath.FromRoundedRect to avoid native assertion/crash
  • 42372 - [mtouch] Treat P/Invokes to 'sqlite3' as equal to 'libsqlite3'
  • 42473 - [mtouch] Don't link native libraries into the main executable if we're doing an incremental build
  • 42929 - [uikit] Add missing [NullAllowed] on UIImageView ctors
  • 42936 - [foundation] Fix 401s in the NSUrlSessionHandler
  • 42967 - [uikit] Add UIFontTextStyle enum to ease UIFont[Descriptor].GetPreferred* API usage
  • 43430 - [security] Obj-C Exception when accessing a SecRecord created by Flurry library
  • 43579 - [generator] Emits invalid code when using overloads in @delegates using events and C# delegates
  • 44062 - [security] SecRecord is missing a property to enable password access control
  • 44154 - [coremedia] ClockOrTimebase should retain the pointer in the constructor that takes a handle
  • 44192 - [modelio] Add missing availability attributes on new API
  • 44201 - [avfoundation] Add missing setters on AVAssetDownloadOptions properties
  • 44257 - [msbuild] Add watch-companion to UIRequiredDeviceCapabilities for watchOS1 extensions
  • 44309 - [registrar] Look up the right type when getting the constrained type for a generic type
  • 44322 - [avfoundation] AVAssetDownloadUrlSession.CreateSession throws a System.InvalidCastException
  • 44348 - [msbuild] Include the CFBundleVersion in the archive manifest
  • 44399 - [corefoundation] Allow null argument in AddObserver
  • 44438 - [coreimage] Add missing property ColorSpace to CIImage
  • 44455 - [foundation] Add a few missing NSAttributedString methods to watchOS
  • 44456 - [watchkit] Bind [WKInterfaceDevice preferredContentSizeCategory] as PreferredContentSizeCategoryString
  • 44568 - [runtime] Fix support for debugging on watch device with multiple IP addresses
  • 44701 - [mtouch] Fix NRE when optimizing bindings
  • 44709 - [watchOS] CMDeviceMotion properties aren't all populated with data/cause crash
  • 44763 - [mtouch] Fix NullReferenceException in PInvoke wrapper generation
  • 44775 - [mtouch] Set install_name for libpinvokes.dylib
  • 44841 - [msbuild] Fixed IsWatchExtension state property
  • 44874 - [networkextension] Enable default contructor on NETunnelProviderManager
  • 44926 - [static registrar] Fix registration of generic types
  • 44996 - [mtouch] CoreAudioKit didn't exist in the simulator until iOS 9
  • 45046 - [runtime] Fix xamarin_log to not treat % as format specifiers
  • 45116 - [debugger] Disable managed exception marshaling when the debugger is attached
  • 45223 - [sgen] Fix random GC crash scanning null object references
  • 45240 - [msbuild] Fixed parsing of --gcc_flags=... for mtouch
  • 45742 - [runtime] Use ExceptionDispatchInfo to keep stack traces when unhandled exceptions are marshaled
  • 45762 - [msbuild] Fix binding project LinkWithAttributes generation to prevent unnecessary rebuilds
  • 45800 - [mtouch] Copy third-party frameworks from extensions to the main app's Frameworks directory

  • 44733 - [mtouch] Convert .file directives containing backslashes correctly (10.4.0.25+)

  • 45369 - [watchos] Unexpected EntryPointNotFoundException at runtime (10.4.0.25+)
  • 45140 - [runtime] App Crashes at Launch with KERN_INVALID_ADDRESS (10.4.0.25+)

  • 41231 - [msbuild] Don't rm -rf the .dSYM dir in the _CompileToNative target (10.4.0.33+)

  • 45994 - [security] Remove port number from TLS Server Name Identification (SNI) (10.4.0.41+)

  • 48382 - [avfoundation] Fix incorrect selector for AVPlayerItemVideoOutput .ctor (10.4.0.41+)
  • 49220 - [mtouch] -lsqlite3 is a linker flag, not a file to be linked with, so treat it accordingly (10.4.0.41+)

  • 47064 - [linker] Fix marking types inside custom attributes (10.4.0.54+)

  • 48515 - [msbuild] Don't rewrite MonoTouchDebugConfiguration.txt unless it has changed (10.4.0.54+)
  • 49097 - [msbuild] Prevent rebuilds from re-codesigning if the app bundle is unchanged (10.4.0.54+)
  • 49255 - [mtouch] Don't quote paths until they're passed to external commands (10.4.0.54+)

  • 49056 - [jit] Allow simple TLS accesses in gsharedvt methods (10.4.0.67+)

  • 50454 - [msbuild] Properly clean device-specific output directories (10.4.0.67+)

  • 44811 - [msbuild] Make sure to use the actual filename generated by ibtool (10.4.0.73+)

  • 50791 - [msbuild] Fixed the Inputs for the _CodesignAppBundle target (10.4.0.73+)
  • 50891 - [foundation] Fix possible abort when using NSUrlSessionHandler (10.4.0.73+)
  • 51017 - [aot] Avoid potential NRE in Release/LLVM builds (10.4.0.73+)
  • 51206 - [aot] Avoid a crash in the aot compiler if a delegate doesn't have a [Begin|End]Invoke method (10.4.0.73+)

  • 44568 - [watchOS] Debugger doesn't work on device if mac has multiple IP addresses (10.4.0.88+)

  • 45800 - [mtouch] Include extracted frameworks from binding assemblies when listing the frameworks an extension needs (10.4.0.88+)
  • 46298 - [msbuild] Don't replace * by bundle id in entitlements (10.4.0.88+)
  • 51299 - [mobilecoreservices] Fix UTType.GetDescription null check (10.4.0.88+)
  • 51336 - [mtouch] Fix potential MT2001 errors when a broken .mdb file is provided (10.4.0.88+)
  • 51352 - [watchOS] Remove unnecessary bitcode from dylibs (10.4.0.88+)

  • 51548 - [mtouch] Make sure native symbols from third-party libraries are preserved in dylibs (for incremental builds) (10.4.0.96+)

  • 51530 - [debugger] Ensure that we use the correct paths in the mono mdb files (10.4.0.97+)

  • 47750 - [installer] Don't fail install if XMA cannot be uninstalled (10.4.0.114+)

  • 50117 - [debugger][x86] Fix a race in the single stepping seq point assembly (10.4.0.114+)
  • 51710 - [mtouch] Automatically disable incremental builds if building to bitcode and any third-party bindings were found (10.4.0.114+)
  • 51805 - [linker] Properly update ExpertedType.Scope (10.4.0.114+)
  • 52113 - [installer] Fix .mdb files permissions (10.4.0.114+)
  • 52165 - [msbuild] Properly decide on when to re-codesign app bundle (10.4.0.114+)
  • 52241 - [mtouch] Automatically enable bitcode if LLVM is enabled (10.4.0.114+)

  • 51148 - [msbuild] .mdb files not copied for F# projects (10.4.0.121+)

  • 51667 - [mtouch] Reload symbols before re-saving an assembly (10.4.0.121+)

  • 52475 - [aot] Disable llvm for overly complex methods (can cause MT3001 errors) (10.4.0.123+)

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.