Bug 22640 - Update to 3.5.55 results in error AOT Compilation exited with code 134. Could not AOT the assembly...System.Dynamic.dll
Summary: Update to 3.5.55 results in error AOT Compilation exited with code 134. Could...
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 3.5
Hardware: PC Mac OS
: High critical
Target Milestone: 3.6
Assignee: Adrian Alonso
Depends on:
Reported: 2014-09-04 10:29 UTC by Allie Miller
Modified: 2014-09-05 05:26 UTC (History)
9 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Allie Miller 2014-09-04 10:29:08 UTC
After updating to Xamarin for Visual Studio 3.5.55, without making any changes to the code, the build and deployment attempts fails with the following error:

2>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(319,3): error : Could not AOT the assembly '/Users/attila/Library/Caches/Xamarin/mtbs/builds/DailyOneClientiOS/662d63834f8c05075610663c70ca3374/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll'

*Steps to reproduce*
1) On a Windows workstation running Visual Studio with Xamarin for Visual Studio 3.5.5 installed, attempt to compile the attached test project.

*Expected results*
The project should compile successfully.

*Actual results*
The project fails to successfully compile with the above error message.

*Additional Information*
Logs from VS attached. Additional output from the build can be viewed below:

AOT Compilation exited with code 134, command: (TaskId:77) 7> MONO_PATH=/Users/dario/Library/Caches/Xamarin/mtbs/builds/SecureDriveiOS/c8758606ec2fbdca9fb20e1e4c9054f7/obj/iPhone/Debug/mtouch-cache/Build /Library/Frameworks/Xamarin.iOS.framework/Versions/ --debug -O=gsharedvt --aot=mtriple=armv7-ios,full,static,asmonly,direct-icalls,soft-debug,dwarfdebug,no-direct-calls,iphone-abi,outfile=/Users/dario/Library/Caches/Xamarin/mtbs/builds/SecureDriveiOS/c8758606ec2fbdca9fb20e1e4c9054f7/obj/iPhone/Debug/mtouch-cache/System.Dynamic.dll.armv7.s "/Users/dario/Library/Caches/Xamarin/mtbs/builds/SecureDriveiOS/c8758606ec2fbdca9fb20e1e4c9054f7/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll" (TaskId:77) 7> Mono Ahead of Time compiler - compiling assembly /Users/dario/Library/Caches/Xamarin/mtbs/builds/SecureDriveiOS/c8758606ec2fbdca9fb20e1e4c9054f7/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll (TaskId:77) 7> Missing method System.Runtime.InteropServices.Marshal::GetNativeVariantForObject<[1]>(!!0,intptr) in assembly /Users/xxx/Library/Caches/Xamarin/mtbs/builds/SecureDriveiOS/c8758606ec2fbdca9fb20e1e4c9054f7/obj/iPhone/Debug/mtouch-cache/Build/mscorlib.dll, referenced in assembly /Users/dario/Library/Caches/Xamarin/mtbs/builds/SecureDriveiOS/c8758606ec2fbdca9fb20e1e4c9054f7/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll (TaskId:77) 7> * Assertion at ../../../../../mono/mono/metadata/class.c:5607, condition `!mono_loader_get_last_error ()' not met (TaskId:77) 7> (TaskId:77) 7> (TaskId:77) 7>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(319,3): error : Could not AOT the assembly '/Users/dario/Library/Caches/Xamarin/mtbs/builds/SecureDriveiOS/c8758606ec2fbdca9fb20e1e4c9054f7/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll' 7> Tool /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch execution finished. (TaskId:77) 7>Done executing task "MTouchTask" -- FAILED. (TaskId:77) 7>Done building target "_CompileToNative" in project "SecureDrive.iOS.csproj" -- FAILED.: (TargetId:98)

*Versioning Information*
On Mac Build Host Machine
=== Xamarin Studio ===

Version 5.3 (build 440)
Installation UUID: 40ff519c-daa5-4d16-a5fb-7912d6ce4a1c
	Mono 3.8.0 ((no/45d0ba1)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000009

=== Xamarin.Android ===

Not Installed

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.iOS ===

Version: (Business Edition)
Hash: 77efa3f
Build date: 2014-08-26 07:59:55-0400

=== Xamarin.Mac ===


=== Build Information ===

Release ID: 503000440
Git revision: accb55419539e512cff857b14b80ec3107996511
Build date: 2014-09-01 08:53:05-04
Xamarin addins: 6dbac4b3a32df080bf98cde838ce89e573a92859

=== Operating System ===

Mac OS X 10.9.4
Darwin xxx-Mac.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64

On Windows machine
Microsoft Visual Studio Ultimate 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Ultimate

Architecture and Modeling Tools   06181-004-0449004-02772
Microsoft Architecture and Modeling Tools
UML® and Unified Modeling Language™ are trademarks or registered trademarks of the Object Management Group, Inc. in the United States and other countries.

LightSwitch for Visual Studio 2013   06181-004-0449004-02772
Microsoft LightSwitch for Visual Studio 2013

Team Explorer for Visual Studio 2013   06181-004-0449004-02772
Microsoft Team Explorer for Visual Studio 2013

Visual Basic 2013   06181-004-0449004-02772
Microsoft Visual Basic 2013

Visual C# 2013   06181-004-0449004-02772
Microsoft Visual C# 2013

Visual C++ 2013   06181-004-0449004-02772
Microsoft Visual C++ 2013

Visual F# 2013   06181-004-0449004-02772
Microsoft Visual F# 2013

Visual Studio 2013 Code Analysis Spell Checker   06181-004-0449004-02772
Microsoft® Visual Studio® 2013 Code Analysis Spell Checker

Portions of International CorrectSpell™ spelling correction system © 1993 by Lernout & Hauspie Speech Products N.V. All rights reserved.

The American Heritage® Dictionary of the English Language, Third Edition Copyright © 1992 Houghton Mifflin Company. Electronic version licensed from Lernout & Hauspie Speech Products N.V. All rights reserved.

Windows Phone SDK 8.0 - ENU   06181-004-0449004-02772
Windows Phone SDK 8.0 - ENU

ASP.NET and Web Tools   12.3.50717.0
Microsoft Web Developer Tools contains the following components:
Support for creating and opening ASP.NET web projects
Browser Link: A communication channel between Visual Studio and browsers
Editor extensions for HTML, CSS, and JavaScript
Page Inspector: Inspection tool for ASP.NET web projects
Scaffolding: A framework for building and running code generators
Server Explorer extensions for Microsoft Azure Websites
Web publishing: Extensions for publishing ASP.NET web projects to hosting providers, on-premises servers, or Microsoft Azure

ASP.NET Web Frameworks and Tools 2012.2   4.1.21001.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.20703.0
For additional information, visit http://www.asp.net/

Common Azure Tools   1.2
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

File Nesting   1.0
Automatically nest files based on file name and enables developers to nest and unnest any file manually

JetBrains ReSharper 8.2.1   C# Edition build 8.2.1000.4556 on 2014-05-19T10:12:38
JetBrains ReSharper 8.2.1 package for Microsoft Visual Studio. For more information about ReSharper, visit http://www.jetbrains.com/resharper/. Copyright © 2003–2014 JetBrains, Inc.

Microsoft Advertising SDK for Windows Phone   
Microsoft Advertising SDK for Windows Phone

Microsoft Azure Mobile Services Tools   1.2
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.4
Microsoft Azure Tools for Microsoft Visual Studio 2013 - v2.4.20730.1601

Nemerle   1.0
Nemerle Visual Studio Integration
Version 1.0

Nitra Language Framework for Microsoft VisualStudio   1.0
Nitra Language Framework helps developing domain specific languages (DSL)

NuGet Package Manager   2.8.50313.46
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Office Developer Tools for Visual Studio 2013 ENU   12.0.30626
Microsoft Office Developer Tools for Visual Studio 2013 ENU

PowerShell Tools for Visual Studio   1.0
Information about my package

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   12.0.40706.0
Microsoft SQL Server Data Tools

Web Essentials 2013   2.3
Adds many useful features to Visual Studio for web developers.

Windows Phone 8.1 SDK Integration   1.0
This package integrates the tools for the Windows Phone 8.1 SDK into the menus and controls of Visual Studio.

Workflow Manager Tools 1.0   1.0
This package contains the necessary Visual Studio integration components for Workflow Manager.

Xamarin (2db5ccd228887372e207e112bc3b5f1b16b24293)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android

For more information, please see http://codeplex.studioshell.com
Comment 2 PJ 2014-09-04 11:17:38 UTC
Adding for assessment for 3.6.
Comment 3 Jose Gallardo 2014-09-04 15:57:08 UTC
We identified the issue in the provided Test Solution.

The project "SecureDrive.Api" contains a reference to the wrong Newtonsoft.Json.dll library.
Instead of pointing to the one located in "packages\Newtonsoft.Json.6.0.4\lib\portable-net40+sl5+wp80+win8+wpa81" it's pointing to the one from "portable-net45+wp80+win8+wpa81".

The second one carries dependencies to Microsoft.CSharp which is also carrying System.Dynamic, hence we cannot build the project.

Fixing the reference (pointing to the right one) makes the project to build without issues.
Comment 4 AttilaH 2014-09-05 05:26:38 UTC
Modifying the reference by help solved my issue too, but this is just a workaround.

In my case the same library caused the problem. I've referenced it from a Profile78 Portable class library.

That's why it referenced the dll from the portable-net45+wp80+win8+wpa81 directory.

What should be the good fix for these cases?

Long term a dependency analysis by the xamarin compilers would be awesome and that should make the root cause more detectable.