Category Archives: Technical Bulletin

Preview: Xcode 9 beta 3, iOS 11, macOS 10.13 support – Preview 1

Today we are releasing the following builds as Xcode 9 Web Preview 1. These versions include preview Xamarin SDK bindings and preview IDE compatibility for Apple’s Xcode 9 beta 3 release.

Note that these are standalone download links that are not published in the Xamarin updater channels. As a result, Visual Studio for Mac and Visual Studio 2015 on Windows will offer “updates” back to the current published updater channel versions when you have these versions installed. You will need to disregard those notifications if you wish to keep using these Xcode 9 support previews.

Any bug reports about these preview Xamarin bindings are much appreciated!


Products Released

Preview IDE compatibility packages for Mac and Visual Studio 2015

  • Visual Studio for Mac 7.1.0.1267
  • Download
  • Xamarin.VS 4.6.0.328 (Visual Studio 2015)
  • Download

Preview IDE compatibility installation steps for Visual Studio 2017 Preview

  • Xamarin.VS 4.6.0.328 (for Visual Studio 2017 Preview)
  1. Ensure that you have Visual Studio 2017 Preview version 15.3.0 Preview 4 installed with the Mobile development with .NET workload. (Note that Visual Studio 2017 Preview installs as an additional version alongside your existing Visual Studio 2017 non-preview version.)
  2. Go to Tools > Extensions and Updates…
  3. Open the Online > Visual Studio Marketplace tab.
  4. Search for Xamarin Updater and press Download
    • Created by: Xamarin
  5. Restart Visual Studio (as instructed).
  6. Go to Tools > Options > Extensions and Updates.
  7. Click the Add button next to the Additional Extension Galleries list.
  8. Under the Name field enter Xamarin Xcode 9 Preview (or another name that you prefer).
  9. Under the URL field type in xvs://xcode9-preview/
  10. Click OK to save the changes.
  11. Navigate to Tools > Extensions and Updates > Updates > Xamarin Xcode 9 Preview and press Update for each item to download all the available updates.
  12. Once all of the downloads are complete, close Visual Studio.  The VSIX Installer program will launch automatically to install the components.
  13. Start Visual Studio again.

Uninstall steps for Visual Studio 2017 Preview

If you wish to switch back from the Xcode 9 support previews to the default Xamarin versions bundled in Visual Studio 2017 Preview, use the Visual Studio Installer to un-install, and then re-install, the Mobile development with .NET (Xamarin) workload.

Common issues in the Xamarin 15.2.2 release being tracked by the Xamarin team

In case it might be useful for reference, here is an update on the previous list of commonly seen issues from the Xamarin 15.2 release. Many of those issues are now resolved in the Xamarin 15.2.2 release.  This updated list gives the latest statuses and workarounds for a few remaining issues from the Xamarin 15.2 release and the Xamarin 15.2.2 release, with a focus on bug reports that have several subscribed users.

  • Bug 56787 [Xamarin.VisualStudio, Xamarin.iOS, Xamarin.Android] “Could not load file or assembly ‘Mono.Posix, Version=2.0.0.0, …'” in some cases when attempting to start debugging with breakpoints set. This happens because the Mono.Posix.dll file is missing from the Xamarin.VisualStudio installer.
    • Temporary workaround:
      1. Download the missing Mono.Posix file and unzip the archive.
      2. Right-click the Mono.Posix.dll file in Explorer and select Properties.
      3. Check the Digital Signatures tab to ensure the file shows a valid Xamarin Inc. signature.
      4. At the bottom of the General tab, if an Unblock checkbox appears, enable it and select OK. (This checkbox appears depending on how the file was downloaded.)
      5. For Visual Studio 2017, copy the Mono.Posix.dll file into the “Xamarin.VisualStudio” extension directory. For example, for a default installation of the Enterprise edition, copy the file into:
        C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio
      6. For Visual Studio 2015, copy the file into the “Xamarin\Xamarin” extension directory:
        C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\Extensions\Xamarin\Xamarin\
      7. Quit and restart Visual Studio.
    • If these steps to do not resolve the issue in your environment, please see the bug report for information about enabling “Fusion logging” (assembly binding logging) and submitting a new bug report for further investigation.
  • Bug 56893 and Bug 56808 [Xamarin.VisualStudio, Xamarin.iOS] Breakpoints are non-functional  and exception call stacks show user code as “External Code” in certain scenarios when debugging on iOS devices and simulators with the linker enabled.
    • Possible temporary workaround: Change the DebugType to portable to more closely match the build behavior of Visual Studio for Mac.
      1. Open each project .csproj file in a text editor. For example, right-click each project in the Solution Explorer and select Unload Project, and then right-click it again and select Edit.
      2. Under the PropertyGroup for the “Debug|AnyCPU” configuration, set:
        <DebugType>portable</DebugType>
      3. Save the changes and reload the projects.
      4. Clean the solution and manually delete the “bin” and “obj” folders to remove any left-over .mdb debugger symbol files.
      5. If any of the projects use async partial methods, install the Microsoft.Net.Compilers  pre-release version 2.3.0-beta1 NuGet package (or higher) into all of the projects (to fix Roslyn issue 17934).
  • Bug 56246 [Mono, Xamarin.Android, Xamarin.iOS, Xamarin.Mac] Tracking bug for upstream Roslyn issue 17934: “error MSB6006: “csc.exe” exited with code 1″ due to KeyNotFoundException when compiling projects that include async partial methods.
    • Possible temporary workaround: Install the Microsoft.Net.Compilers  pre-release version 2.3.0-beta1 NuGet package (or higher) into all of the projects to get the pre-release Roslyn C# compiler that includes the fix.
    • Alternate temporary workaround: Switch back to mcs and xbuild.
      1. Add the following PropertyGroup element to the bottom of the .csproj file for your app project just before the closing </Project> tag:
        <PropertyGroup Condition=" '$(OS)' == 'Unix' ">
            <CscToolExe>mcs.exe</CscToolExe>
        </PropertyGroup>
      2. Disable Visual Studio > Preferences > Build > Build with MSBuild instead of xbuild. (This setting is also available in Xamarin Studio 6.3. It is disabled by default in Xamarin Studio, but some users might have enabled it by hand in the past.)
      3. Close and reopen the solution to ensure the new setting is used.
      4. Clean and rebuild the project.
    • developercommunity 63718 [Xamarin.VisualStudio] In certain environments, Visual Studio crashes often due to an unhandled exception in a Zeroconf method called by Xamarin.VisualStudio.ZeroConf.MacDiscoveryService.

Common issues from the Xamarin 15.2 release being tracked by the Xamarin team

In case it might be useful for reference, here is an in-progress list of some commonly seen issues being tracked by the Xamarin team for the Xamarin 15.2 release. The list is sorted approximately by the number of users subscribed to each bug report, and in some cases also by additional hand-tallying. The list focuses on issues where the pattern of reports suggests a change in behavior compared to the Xamarin 15.1 release. This list is not exhaustive: It does not include every issue user-submitted issue reported since the time of the Xamarin 15.2 release.

  • Bug 56275 and developercommunity 54945 [Xamarin.VisualStudio] Significant increase in the chances of hitting “Unable to copy file “obj\Debug\App1.dll” to “bin\Debug\App1.dll”. The process cannot access the file ‘bin\Debug\App1.dll’ because it is being used by another process.” and “Exceeded retry count of 10. Failed”. Under investigation.
    • A few possible temporary workarounds are discussed on the bug report.
    • One comment on the report also indicates that installing and using the Visual Studio 2017 Preview version 15.3 might resolve the issue.
  • Bug 56246 [Mono, Xamarin.Android, Xamarin.iOS, Xamarin.Mac] Tracking bug for upstream Roslyn issue 17934: “error MSB6006: “csc.exe” exited with code 1″ due to KeyNotFoundException when compiling projects that include async partial methods. Integration of the upstream Roslyn fix is in-progress.
    • Partial temporary workaround: Switch back to mcs and xbuild (see additional details below).
  • Bug 56213 [Xamarin.VisualStudio] “Can not resolve reference: C:/Windows/Microsoft.NET/Framework/v4.0.30319/de/mscorlib.resources.dll” when building or breakpoints fail to hit on iOS devices when debugging. Now RESOLVED in the source code, and will be included in an upcoming release.
  • Bug 55087 [Xamarin.Android] “System.NotSupportedException: Stack walks are not supported on this platform – System.Reflection.MethodBase.GetCurrentMethod” when attempting to debug on x86_64 Android emulators. Now RESOLVED in the source code, and will be included in an upcoming release.
    • Partial temporary workaround: Use an x86 Android emulator rather than an x86_64 Android emulator.
  • Bug 56296 [Xamarin.Forms] “MTOUCH: error MT2001: Could not link assemblies.” when attempting to link Xamarin.Forms projects that use XamlC on iOS because XamlC does not update the new default portable .pdb debug symbol files. Now RESOLVED in the source code, and will be included in an upcoming release of Xamarin.Forms.
    • Possible temporary workaround: Disable XamlC.
    • Alternate possible temporary workaround: Switch back to mcs and xbuild (see additional details below).
  • Bug 56240 [Xamarin.Android] Performance degradation when using System.Linq.Expressions in Xamarin.Android 7.3. A candidate change has been added and will be included in an upcoming release of Xamarin.Android.
  • Bug 56238 and developercommunity 49033 [Xamarin.Android] App exits on launch or fails to hit breakpoints when debugging due to change in default build behavior when the Optimize MSBuild property is not explicitly set. Now RESOLVED in the source code, and will be included in an upcoming release.
    • Workaround: Explicitly set the Optimize property to False in the .csproj file. See the answer on the developercommunity item for a few additional details.
  • Compatibility change: [Xamarin Studio] Breakpoints no longer work for certain Xamarin project types and scenarios in Xamarin Studio 6.3 due incomplete support for the new default portable .pdb format generated by Mono 5.0.
    • Recommended solution: Install and use Visual Studio for Mac now that it is generally available and the recommended environment for Xamarin development on Mac.
    • Alternate possible temporary workaround: Switch back to mcs and xbuild (see additional details below).
  • Bug 56192 [Xamarin.VisualStudio] MultiDex is disabled after saving changes to Xamarin.Android project due to incorrect MSBuild property name <AndroidEnableMultipleDex>. Now RESOLVED in the source code, and will be included in an upcoming release.
    • Workaround: In the .csproj file, replace all occurrences of AndroidEnableMultipleDex with the correct property name AndroidEnableMultiDex using a text editor.
  • Bug 56220 [Xamarin.iOS, Xamarin.VisualStudio] “The item “C:….nuget\packages\Autofac\4.5.0\lib\netstandard1.1\Autofac.dll” in item list “ReferenceCopyLocalPaths” does not define a value for metadata “ResolvedFrom””. Under investigation. A few possible temporary workarounds are discussed on the bug report.
    • A possible temporary workaround is mentioned on the bug report.

Temporarily switching back to mcs and xbuild

The Xamarin 15.2 release includes Mono 5.0, which enables the Roslyn csc C# compiler by default and deprecates the use of xbuild in favor of msbuild. For the Xamarin toolchain, this adds C# 7 support and changes the default debugging symbol format from .mdb files to portable .pdb files. And Visual Studio for Mac uses msbuild by default when building projects.

The change from mcs to csc and xbuild to msbuild is related to several of the issues listed above. One potential workaround in those cases is to switch back to the earlier combination of mcs and xbuild without downgrading Mono or the Xamarin toolchain. As a caution, this is not a tested scenario, so although this approach has been reported to work well so far, it does still have a chance of hitting other secondary errors.

  1. Add the following PropertyGroup element to the bottom of the .csproj file for your app project just before the closing </Project> tag:
    <PropertyGroup Condition=" '$(OS)' == 'Unix' ">
        <CscToolExe>mcs.exe</CscToolExe>
    </PropertyGroup>
    
  2. Disable Visual Studio > Preferences > Build > Build with MSBuild instead of xbuild.(This setting is also available in Xamarin Studio 6.3. It is disabled by default in Xamarin Studio, but some users might have enabled it by hand in the past.)
  3. Close and reopen the solution to ensure the new setting is used.
  4. Clean and rebuild the project.

Technical Bulletin: Xcode 8.3 Support for VS 2017

Update: Visual Studio 2017 (26228.12) from March 31 includes Xamarin Xcode 8.3 support

Be sure to update to Visual Studio 2017 15.0.26228.12 or higher via the Tools > Extensions and Updates menu to get Xcode 8.3 compatibility for the Xamarin extensions.


Old alternate manual update steps (from March 28)

With the release of Visual Studio 2017 and the new Visual Studio Installer, there were some changes to how the Xamarin extensions for Visual Studio get installed and updated. In VS 2017, Xamarin updates will now generally be published as an integrated part of the Visual Studio Product Updates in the Extensions and Updates menu. However, the Visual Studio Product Update from earlier today (26228.10) does not yet include Xamarin’s Xcode 8.3 support. Xcode 8.3 support will instead be included in a Visual Studio Product Update for the final versions of Xamarin 15.1, which are coming soon.

In the interim, we are providing downloadable versions of the Xamarin.VisualStudio and Xamarin.iOS extensions for VS 2017 that support Xcode 8.3.  In order to use these versions, please download them from the respective links below, and follow these instructions:

  1. If by chance either file downloads with a “.zip” extension in your browser, rename it back to “.vsix” (for example after enabling the  View > File name extensions checkbox in Windows Explorer).
  2. Shut down all instances of VS 2017 currently running.  We suggest you also close any instances of VS 2015 or 2013 as well.
  3. Double click the Xamarin.VisualStudio VSIX file.
  4. A pop up window with a number of checkbox options will appear. Select only the Visual Studio 2017 checkboxes. Be sure to un-check any checkboxes present for Visual Studio 2015 and lower. Then click the install button.
  5. Once installation of the Xamarin.VS VSIX file has fully completed, repeat steps 2 & 3 for the Xamarin.Apple.Sdk VSIX file.
  6. Once installation of both Xamarin.VS and Xamarin.iOS are complete, restart VS 2017, and confirm the new Xamarin and Xamarin.iOS extensions are installed by checking the versions listed in Help > About Microsoft Visual Studio.

If you see a behavior that looks suspicious in these versions, and if it isn’t clear whether one of the known issues in the release notes matches the problem, please file a quick bug report to let the team know.

If you notice an error in this blog post or have trouble downloading one of the installer packages, please let us know in the corresponding forum thread.


Products Released


Uninstalling this Update from Visual Studio 2017

In the event that these versions need to be uninstalled, the Visual Studio Installer can be used to accomplish this. Read the uninstalling Xamarin guide for more information.

Note that uninstalling these manually installed VSIX files through this process will fully remove the Xamarin.VisualStudio extension from VS 2017. You will need to re-install the Xamarin component through the Visual Studio Installer to restore the previous Xamarin 4.3.0.784 version in VS 2017.

Technical Bulletin: Xcode 8.3

As announced on Apple’s developer news site, Apple has just released Xcode 8.3 final.

Xamarin is proceeding as usual to test for compatibility and publish an updated version of Xamarin.iOS for any modified or new APIs in Xcode. Keep an eye on this blog for status updates.

UPDATE March 28: Corresponding new versions of Xamarin.iOS, Xamarin for Visual Studio, and Xamarin Studio are now available. See the release announcement for additional details.

Technical Bulletin: Updating Xamarin Visual Studio 2017 & Side-by-Side

With the release of Visual Studio 2017, there have been questions on whether Visual Studio 2015 can be installed on the same machine. It is currently possible to install the two side-by-side on the same machine successfully. Do note that at the moment, Xamarin for Visual Studio 2017 is one build behind the version for Visual Studio 2015.

Xamarin coordination with the upstream schedule has been evolving across the VS 2017 releases, and plans are underway to synchronize more tightly as soon as possible. Watch for additional news on that topic over the next week.


Update Channels and Visual Studio 2017:

Visual Studio 2017 does not support Xamarin Alpha, Beta, and Stable channels in the same way as earlier versions of Visual Studio (or Xamarin Studio), but a Release and Preview model instead. To install a Preview instance alongside a stable install, download and run the Visual Studio Preview installer, selecting the Preview option during the install process as shown below:

vs2017-installer-sml

The Preview version of Visual Studio may include corresponding Preview versions of Xamarin functionality, including:

  • Forms
  • Xamarin Visual Studio Extension
  • Xamarin Profiler
  • Xamarin Workbooks/Inspector
  • Xamarin Remote iOS Simulator

More information is available in the Visual Studio 2017 Preview FAQ as well as in our documentation on updating.


Uninstalling Visual Studio 2017 Preview:

In the event that a preview version of Visual Studio 2017 needs to be uninstalled, the Visual Studio Installer can be used to accomplish this. Read the uninstalling Xamarin guide for more information.

⚠ Additional Considerations:

At the moment, uninstalling one of the side-by-side installations of Visual Studio 2017 will partially affect the Xamarin installation resulting in removal of the following dependencies from the target machine:

  • Xamarin Profiler
  • Xamarin Workbooks/Inspector
  • Xamarin Remote iOS Simulator
  • Apple Bonjour

This does not impact the remaining Visual Studio 2017 installation, but can have effects on building iOS solutions, profiling apps, and will completely remove Workbooks/Inspector and the Remote iOS Simulator.

To bring the remaining installation of Visual Studio 2017 back to its full feature set and restore the tools listed above and their functionality in the IDE, use the Visual Studio 2017 installer to repair the installation.

Stable Release: Updated Cycle 8 Service Release 1 w/ Xcode 8.2 Support

We are releasing an updated version of Cycle 8 Service Release 1 to the Stable channel which provides Xcode 8.2 support on top of our existing Stable builds. Please check out the product release notes to see all the fixes and known issues for this release.

If you notice an error in this blog post or have trouble downloading one of the installer packages, please let us know in the corresponding forum thread.


Known Issues

  • [Xamarin Studio]43188 – Sporadic “Out of memory” error during build leaves solution in an unbuildable state until the project is reloaded.
    • Improved in this release: Cycle 8 Service Release 1 includes some fixes that should hopefully eliminate the need to reload the project in this scenario. Additional fixes for the “Out of memory” error itself are also planned.

Products Released


Updating and downgrading
You can install this new version by checking for updates on the Stable updater channel.
You can downgrade back to the previous Cycle 8 Service Release 1 (from November 16) versions by manually reinstalling each old package. See the KB article on downgrading. If you would prefer an email with any older installer links you need, feel free to write to contact@xamarin.com to request the older versions.

  • For Mac you’ll need: Xamarin.iOS.
  • For Windows you’ll need: Xamarin.VisualStudio (from either the Xamarin.Android or Xamarin.iOS drop-down menu).

Technical Bulletin: Xcode 8.2

As announced on Apple’s developer news site, Apple has just released Xcode 8.2 final.

Xamarin is proceeding as usual to test for compatibility and publish an updated version of Xamarin.iOS for any modified or new APIs in Xcode. Keep an eye on this blog for status updates.

UPDATE: Corresponding new builds of Xamarin.iOS, Xamarin for Visual Studio, and Xamarin Profiler are now available. More info can be found here.

Technical Bulletin: Xcode 8.1 GM

As announced on Apple’s developer news site, Apple has just released the Xcode 8.1 GM seed.

Due to a few changes in the Xcode 8.1 GM version as compared to the previous Beta, Xamarin recommends against updating to Xcode 8.1 GM until a corresponding Xamarin compatibility release has been provided. Work is in progress to publish the core compatibility changes needed. The fixes for 45676 and 45855 are particularly important to make it straightforward to deploy to iOS devices and simulators without tricky workarounds.  New builds will tentatively be available before the end of the week.


Higher visibility known issues

  • [Xamarin for Visual Studio]45676 – “Failed to launch the simulator: Could not load the framework ‘libswiftAppKit.dylib’ … Library not loaded: @rpath/libswiftQuartzCore.dylib” when attempting to launch iOS 10.1 simulator.
  • [Xamarin.iOS]45855 – “Failed to launch the simulator: Could not load the framework ‘libswiftos.dylib’ (path: /Applications/Xcode.app/Contents/Frameworks/libswiftos.dylib): not found.” when attempting to launch iOS 10.1 simulator. Note: The public bug report mentions a fairly simple although inelegant workaround.
  • 45859 – “Error MT0074: Xamarin.iOS 10.0.2 does not support a deployment target of 10.1 for iOS (the maximum is 10.0).” when attempting to build a new template project that uses the new default deployment target of 10.1
    • Workaround: Open the Info.plist file in the plist editor and change the deployment target to 10.0 or lower instead of 10.1.
  • [Xamarin Studio], [Xamarin for Visual Studio] – 45861, 45862 – “May Slow Down Your iPhone … The developer of this app needs to update it to improve its compatibility.” because of default “i386” supported architecture setting in the iPhoneSimulator configuration on new projects
    • Fix: Change Project options > iOS Build > Supported architectures to x86_64 (instead of the default i386) for the iPhoneSimulator configuration.
  • [Xamarin.iOS] – 45899 – “error HE0035: Could not find a paired iPhone device for the Watch ‘watchOS 3.1 (14S471a) – Apple Watch – 42mm’ (C64439C5-9D9C-4B5C-B3B5-F77BBAA5B669)” when attempting to launch watch app on series1 sim

Intentional changes in Xcode 8.1 itself
As usual, be sure to also check the upstream release notes.

  • “May Slow Down Your iPhone … The developer of this app needs to update it to improve its compatibility.” alert dialog will be displayed when 32-bit applications are launched on 64-bit devices and simulators.
    • Fix: Be sure to configure your project to provide a 64-bit build for 64-bit devices.

Edits on this post

  • Oct 25, 2016: Add Bug 45899.

Technical Bulletin: Android SDK Build-tools 24

Version “24” of the Android SDK Build-tools package contains an upstream bug in aapt that can cause at least 2 errors:

  • ​””aapt.exe” exited with code -1073741819″ (This error can also appear if the Android SDK Build-tools version is not compatible with the installed version of Xamarin.Android. But in this particular case the error is due to the upstream bug.)
  • “The file “obj\Debug\android\bin\packaged_resources” does not exist.”

This bug has been fixed in Android SDK Build-tools 24.0.1.

Recommended fix: Uninstall Android SDK Build-tools version 24 using the Android SDK Manager.


Another separate issue is that versions 24 and higher of the Android SDK Build-tools package require Java JDK 8 or higher. This can cause at least 1 error:

  • “java.lang.UnsupportedClassVersionError: com/android/dx/command/Main : Unsupported major.minor version 52.0”

Possible ways to fix:

  • Update to Java JDK 8, and then make sure that JDK 8 is selected in the Xamarin preferences:
    • Visual Studio: Tools > Options > Xamarin > Android Settings > Java Development Kit Location.
    • Xamarin Studio (on Mac): Xamarin Studio > Preferences > Projects > SDK Locations > Android > Java SDK (JDK).
  • Or uninstall all Android SDK Build-tools versions 24 and higher via the Android SDK manager.
  • Or set the AndroidSdkBuildToolsVersion MSBuild property to an earlier version. For example, if you also have version 23.0.3 installed, you could add the following line within the top <PropertyGroup> element in the Android project .csproj file:
    <AndroidSdkBuildToolsVersion>23.0.3</AndroidSdkBuildToolsVersion>

(Edited on July 14, 2016: Simplify the recommendations and provide a link to the upstream bug.)
(Edited on July 25, 2016: Mention the new version Android SDK Build-tools 24.0.1.)
(Edited on August 11, 2016: Add a note about checking the JDK version in the Xamarin preferences.)