Forum Xamarin.iOS

New "Could not AOT the assembly" errors using Xamarin.iOS 7.4.0.108

Looking for some help with this issue. My Xamarin.iOS projects were building fine, and then I updated to Xamarin.iOS 7.4.0.108. I made no source changes.

Now, debug builds fail with:
C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(319,3): error : Could not AOT the assembly '…/Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll'

And release builds fail with:
C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(319,3): error : Failed to resolve "System.Reflection.Emit.ModuleBuilder" reference from "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

I’m developing on a PC using the VS plug-in:
Xamarin for Visual Studio v 3.5.55.0

Mac Build Host info:
Xamarin Studio v. 5.3 (build 440)
Xamarin.iOS 7.4.0.108

I think this is the interesting info from diagnostic debug build output:
Missing method System.Runtime.InteropServices.Marshal::GetNativeVariantForObject<[1]>(!!0,intptr) in assembly …/Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build/mscorlib.dll, referenced in assembly …/Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll (TaskId:1983)

More from the build output:
6> Executing task: Xamarin.iOS.Tasks.MTouchTask (TaskId:1983)
6> Tool /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch execution started with arguments: --cache "obj/iPhone/Debug/mtouch-cache" --nomanifest --nosign --dev "bin/iPhone/Debug/project.app" --debug --profiling --nolink --sdkroot "/Applications/Xcode.app/Contents/Developer" --sdk "7.1" --targetver "7.0" --sgen --abi=armv7 --gcc_flags "\"-weak_framework\" \"AdSupport\"" -r "bin/iPhone/Debug/FiksuBinding.dll" -r "bin/iPhone/Debug/monotouch.dll" -r "bin/iPhone/Debug/mscorlib.dll" -r "bin/iPhone/Debug/OpenTK.dll" -r "bin/iPhone/Debug/ProjectStrings.dll" -r "bin/iPhone/Debug/System.Core.dll" -r "bin/iPhone/Debug/System.dll" -r "bin/iPhone/Debug/System.Json.dll" -r "bin/iPhone/Debug/System.Runtime.Serialization.dll" -r "bin/iPhone/Debug/System.ServiceModel.Web.dll" -r "bin/iPhone/Debug/System.Web.Services.dll" -r "bin/iPhone/Debug/System.Xml.dll" -r "bin/iPhone/Debug/System.Xml.Linq.dll" -r "bin/iPhone/Debug/YVI.Ads.dll" -r "bin/iPhone/Debug/YVI.Core.dll" -r "bin/iPhone/Debug/YVI.IOSAL.dll" -r "bin/iPhone/Debug/System.Collections.Concurrent.dll" -r "bin/iPhone/Debug/System.Collections.dll" -r "bin/iPhone/Debug/System.ComponentModel.Annotations.dll" -r "bin/iPhone/Debug/System.ComponentModel.dll" -r "bin/iPhone/Debug/System.ComponentModel.EventBasedAsync.dll" -r "bin/iPhone/Debug/System.Diagnostics.Contracts.dll" -r "bin/iPhone/Debug/System.Diagnostics.Debug.dll" -r "bin/iPhone/Debug/System.Diagnostics.Tools.dll" -r "bin/iPhone/Debug/System.Dynamic.Runtime.dll" -r "bin/iPhone/Debug/System.Globalization.dll" -r "bin/iPhone/Debug/System.IO.dll" -r "bin/iPhone/Debug/System.Linq.dll" -r "bin/iPhone/Debug/System.Linq.Expressions.dll" -r "bin/iPhone/Debug/System.Linq.Parallel.dll" -r "bin/iPhone/Debug/System.Linq.Queryable.dll" -r "bin/iPhone/Debug/System.Net.NetworkInformation.dll" -r "bin/iPhone/Debug/System.Net.Primitives.dll" -r "bin/iPhone/Debug/System.Net.Requests.dll" -r "bin/iPhone/Debug/System.ObjectModel.dll" -r "bin/iPhone/Debug/System.Reflection.dll" -r "bin/iPhone/Debug/System.Reflection.Extensions.dll" -r "bin/iPhone/Debug/System.Reflection.Primitives.dll" -r "bin/iPhone/Debug/System.Resources.ResourceManager.dll" -r "bin/iPhone/Debug/System.Runtime.dll" -r "bin/iPhone/Debug/System.Runtime.Extensions.dll" -r "bin/iPhone/Debug/System.Runtime.InteropServices.dll" -r "bin/iPhone/Debug/System.Runtime.InteropServices.WindowsRuntime.dll" -r "bin/iPhone/Debug/System.Runtime.Numerics.dll" -r "bin/iPhone/Debug/System.Runtime.Serialization.Json.dll" -r "bin/iPhone/Debug/System.Runtime.Serialization.Primitives.dll" -r "bin/iPhone/Debug/System.Runtime.Serialization.Xml.dll" -r "bin/iPhone/Debug/System.Security.Principal.dll" -r "bin/iPhone/Debug/System.ServiceModel.Http.dll" -r "bin/iPhone/Debug/System.ServiceModel.Primitives.dll" -r "bin/iPhone/Debug/System.Text.Encoding.dll" -r "bin/iPhone/Debug/System.Text.Encoding.Extensions.dll" -r "bin/iPhone/Debug/System.Text.RegularExpressions.dll" -r "bin/iPhone/Debug/System.Threading.dll" -r "bin/iPhone/Debug/System.Threading.Tasks.dll" -r "bin/iPhone/Debug/System.Threading.Tasks.Parallel.dll" -r "bin/iPhone/Debug/System.Xml.ReaderWriter.dll" -r "bin/iPhone/Debug/System.Xml.XDocument.dll" -r "bin/iPhone/Debug/System.Xml.XmlSerializer.dll" -r "bin/iPhone/Debug/System.Runtime.dll" -r "bin/iPhone/Debug/System.Runtime.Extensions.dll" -r "bin/iPhone/Debug/System.Collections.dll" -r "bin/iPhone/Debug/YVI.AdsShared.dll" -r "bin/iPhone/Debug/System.Resources.ResourceManager.dll" -r "bin/iPhone/Debug/System.Threading.dll" -r "bin/iPhone/Debug/System.Text.Encoding.dll" -r "bin/iPhone/Debug/System.Globalization.dll" -r "bin/iPhone/Debug/System.Linq.dll" -r "bin/iPhone/Debug/System.Xml.XmlSerializer.dll" -r "bin/iPhone/Debug/System.Xml.ReaderWriter.dll" -r "bin/iPhone/Debug/System.IO.dll" -r "bin/iPhone/Debug/System.Text.RegularExpressions.dll" -r "bin/iPhone/Debug/Ionic.Zlib.CF.dll" -r "bin/iPhone/Debug/Newtonsoft.Json.dll" -r "bin/iPhone/Debug/System.Runtime.Serialization.Primitives.dll" -r "bin/iPhone/Debug/System.Dynamic.Runtime.dll" -r "bin/iPhone/Debug/System.ObjectModel.dll" -r "bin/iPhone/Debug/System.Linq.Expressions.dll" -r "bin/iPhone/Debug/System.Xml.XDocument.dll" -r "bin/iPhone/Debug/System.Threading.Tasks.dll" -r "bin/iPhone/Debug/System.Reflection.dll" -r "bin/iPhone/Debug/System.Text.Encoding.Extensions.dll" -r "bin/iPhone/Debug/System.Reflection.Extensions.dll" -r "bin/iPhone/Debug/System.Diagnostics.Debug.dll" -r "bin/iPhone/Debug/System.Diagnostics.Tools.dll" -r "bin/iPhone/Debug/Microsoft.CSharp.dll" -r "bin/iPhone/Debug/System.Core.dll" -r "bin/iPhone/Debug/System.dll" -r "bin/iPhone/Debug/System.Dynamic.dll" -r "bin/iPhone/Debug/System.Security.dll" -r "bin/iPhone/Debug/System.Xml.dll" -r "bin/iPhone/Debug/System.Numerics.dll" -r "bin/iPhone/Debug/System.Configuration.dll" -r "bin/iPhone/Debug/System.Data.SqlXml.dll" "bin/iPhone/Debug/project.exe" (TaskId:1983)
6> Xamarin.iOS 7.4.0 Business Edition using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk (TaskId:1983)
6>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(319,3): warning : The executable name (project) and the app name (project.app) are different, this may prevent crash logs from getting symbolicated properly.
6> AOT Compilation exited with code 134, command: (TaskId:1983)
6> MONO_PATH=… /Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build /Library/Frameworks/Xamarin.iOS.framework/Versions/7.4.0.108/bin/arm-darwin-mono-sgen --debug -O=gsharedvt --aot=mtriple=armv7-ios,full,static,asmonly,direct-icalls,soft-debug,dwarfdebug,no-direct-calls,iphone-abi,outfile=… /Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/System.Dynamic.dll.armv7.s "…/Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll" (TaskId:1983)
6> Missing method System.Runtime.InteropServices.Marshal::GetNativeVariantForObject<[1]>(!!0,intptr) in assembly …/Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build/mscorlib.dll, referenced in assembly …/Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll (TaskId:1983)
6> * Assertion at ../../../../../mono/mono/metadata/class.c:5607, condition `!mono_loader_get_last_error ()' not met (TaskId:1983)
6> (TaskId:1983)
6> Mono Ahead of Time compiler - compiling assembly …/Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll (TaskId:1983)
6> (TaskId:1983)
6>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(319,3): error : Could not AOT the assembly '…/Library/Caches/Xamarin/mtbs/builds/…/obj/iPhone/Debug/mtouch-cache/Build/System.Dynamic.dll'
6> Tool /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mtouch execution finished. (TaskId:1983)
6>Done executing task "MTouchTask" -- FAILED. (TaskId:1983)
6>Done building target "_CompileToNative" in project "project.csproj" -- FAILED.: (TargetId:1152)

Thanks!

Posts

  • I have this issue too, except on debug I get
    C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets(319,3): error : Failed to resolve "System.Reflection.Emit.ModuleBuilder" reference from "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"

  • I get it too. Works fine if I build it in Xamarin Studion on the mac. Hopefully we get a quick fix soon...

  • Ok, I updated my Newtonsoft.json via Nuget and it fixed it. Try that (if you use that package).

  • DarioLipariDarioLipari USMember ✭✭

    I have the same issue... but update my nuget packages don't works (like JhonDavidson I use Newtonsoft.json).

    I opened a forum thread and wrote an email su Xamarin Support...

  • DarioLipariDarioLipari USMember ✭✭

    This is my diagnostic build output:

    7> 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/7.4.0.108/bin/arm-darwin-mono-boehm --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/dario/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)

  • RolfBjarneKvingeRolfBjarneKvinge USXamarin Team Xamurai

    If updating broke something (without any other changes), it's probably a bug on our end, in which case please file it at http://bugzilla.xamarin.com (attaching your project so that we can reproduce it as well).

  • edited September 2014

    Thanks for pointing me in the direction of Newtonsoft, JohnDavidson! Unfortunately updating my reference to the latest 6.0.4 does not fix my issue, but I was able to create a minimal project that I believe exposes the same or related issue. On my PC, a Universal iOS project that references the latest Newtonsoft.Json.dll will fail to build with "Failed to resolve "System.Reflection.Emit.ModuleBuilder" - but the same project will build in XS on Mac (and I'm assuming would have worked in VS before I updated Xamarin).

    I've opened a bug and uploaded the project here:
    https://bugzilla.xamarin.com/show_bug.cgi?id=22659

  • That's a bugger. Going to 6.0.4 definitely fixed the problem for me. Took me a while to figure it out though.

  • This problem disappeared for me when I updated to Xamarin Version 5.3 (build 441). I saw a release note concerning iOS builds that could have been involved, or perhaps this was some type of install issue with the previous update. I've seen many complaints about this issue, I'm assuming it is resolved.

  • Hi,
    We do have a similar issue when trying to debug on iOS device from visual studio ultimate 2013 update 4
    The exception we get is
    Failed to resolve System.ServiceModel.NetNamedPipeBinding reference from System.ServiceModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

    We could not find any references to this class anywhere in our solution. Is this a Xamarin bug?

    Please help

    Regards,
    Johannes

Sign In or Register to comment.