Xamarin.Forms iOS Build Failure

Have a Xamarin.Forms project with net standard 2 XF assembly driving UWP and iOS apps. Running XF v3.4.0.1008975 on Visual Studio Community 2017 15.9.4 on the latest Windows 10. Mac that is performing the build is running Mojave 10.14.1 and Visual Studio Mac 7.7.2 (Build 21).

UWP application builds and runs with no problems. iOS build was running without any problems up to about two weeks ago.

Now the iOS build throws out several MT0136 warnings for assemblies that are referenced by the net standard assembly and then crashes out with MT2001 that tells me that encountered an error while processing references of the net standard 2 assembly. This is after the detection of the signing identity output and the linker setting is do not link (debug mode).

Any guidance is greatly appreciated. Note that I already tried common approaches involving deleting bin/obj directories and mac build cache cleanup.

Best Answer

  • HalilDoganBolakHalilDoganBolak US ✭✭
    Accepted Answer

    @Colex - I found the problem and since you are part of the Xamarin team I thought you should know.

    If you have a long running Xamarin.Forms project (I do, it is in production for more than two years) you usually have multiple Xamarin.Forms nuget upgrades. And once you have that you end up Xamarin.Forms nuget thrashing the iOS project file. This is what happened. I had to get rid of a stupid app.config file that was created by that nuget; convert all of the references to the new format and then find that there are seven leftover lines in the project file trying to check for some previous version Xamarin.Forms props. Deleting them manually did the trick.

    For anyone reading this, unless you have an explicit reference miss then manually clean your project file. Good luck.

Answers

  • ColeXColeX Member, Xamarin Team Xamurai

    Have you checked this ?

  • HalilDoganBolakHalilDoganBolak USMember ✭✭

    @ColeX Unfortunately pretty much the same output with the "-v -v -v -v" as mtouch arguments with additional "inner exception" output as shown below:

    2> --- inner exception
    2> Mono.Linker.LoadException: Error while processing references of 'OOVxfAtInvstriOS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'AWSSDK.DynamoDBv2, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'AWSSDK.DynamoDBv2, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604'
    2> at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x000ff] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/cecil/Mono.Cecil/BaseAssemblyResolver.cs:172
    2> at Mono.Linker.AssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x00071] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker/AssemblyResolver.cs:80
    2> at Mono.Linker.LinkContext.Resolve (Mono.Cecil.IMetadataScope scope) [0x00009] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker/LinkContext.cs:215
    2> --- End of inner exception stack trace ---
    2> at Mono.Linker.LinkContext.Resolve (Mono.Cecil.IMetadataScope scope) [0x00033] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker/LinkContext.cs:223
    2> at Mono.Linker.LinkContext.ResolveReferences (Mono.Cecil.AssemblyDefinition assembly) [0x00024] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker/LinkContext.cs:272
    2> at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences (Mono.Cecil.AssemblyDefinition assembly) [0x00039] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker.Steps/LoadReferencesStep.cs:54
    2> at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences (Mono.Cecil.AssemblyDefinition assembly) [0x00056] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker.Steps/LoadReferencesStep.cs:56
    2> --- End of inner exception stack trace ---
    2> at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences (Mono.Cecil.AssemblyDefinition assembly) [0x00063] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker.Steps/LoadReferencesStep.cs:58
    2> at Mono.Linker.Steps.LoadReferencesStep.ProcessAssembly (Mono.Cecil.AssemblyDefinition assembly) [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker.Steps/LoadReferencesStep.cs:42
    2> at Mono.Linker.Steps.BaseStep.Process (Mono.Linker.LinkContext context) [0x0002e] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker.Steps/BaseStep.cs:61
    2> at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x0001f] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker/Pipeline.cs:127
    2> at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List1[Mono.Cecil.AssemblyDefinition]& assemblies) [0x000e0] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Tuning.cs:80 2> --- 2> --- inner exception 2> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'AWSSDK.DynamoDBv2, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604' ---> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'AWSSDK.DynamoDBv2, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604' 2> at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x000ff] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/cecil/Mono.Cecil/BaseAssemblyResolver.cs:172 2> at Mono.Linker.AssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x00071] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker/AssemblyResolver.cs:80 2> at Mono.Linker.LinkContext.Resolve (Mono.Cecil.IMetadataScope scope) [0x00009] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker/LinkContext.cs:215 2> at Mono.Linker.LinkContext.Resolve (Mono.Cecil.IMetadataScope scope) [0x00033] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker/LinkContext.cs:223 2> at Mono.Linker.LinkContext.ResolveReferences (Mono.Cecil.AssemblyDefinition assembly) [0x00024] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker/LinkContext.cs:272 2> at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences (Mono.Cecil.AssemblyDefinition assembly) [0x00039] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker.Steps/LoadReferencesStep.cs:54 2> at Mono.Linker.Steps.LoadReferencesStep.ProcessReferences (Mono.Cecil.AssemblyDefinition assembly) [0x00056] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker.Steps/LoadReferencesStep.cs:56 2> --- 2> --- inner exception 2> Mono.Cecil.AssemblyResolutionException: Failed to resolve assembly: 'AWSSDK.DynamoDBv2, Version=3.3.0.0, Culture=neutral, PublicKeyToken=885c28607f98e604' 2> at Mono.Cecil.BaseAssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x000ff] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/cecil/Mono.Cecil/BaseAssemblyResolver.cs:172 2> at Mono.Linker.AssemblyResolver.Resolve (Mono.Cecil.AssemblyNameReference name, Mono.Cecil.ReaderParameters parameters) [0x00071] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker/AssemblyResolver.cs:80 2> at Mono.Linker.LinkContext.Resolve (Mono.Cecil.IMetadataScope scope) [0x00009] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/external/mono/external/linker/linker/Linker/LinkContext.cs:215 2> --- 2> at MonoTouch.Tuner.Linker.Process (MonoTouch.Tuner.LinkerOptions options, MonoTouch.Tuner.MonoTouchLinkContext& context, System.Collections.Generic.List1[Mono.Cecil.AssemblyDefinition]& assemblies) [0x003ad] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Tuning.cs:122
    2> at Xamarin.Bundler.Target.LinkAssemblies (System.Collections.Generic.List1[Mono.Cecil.AssemblyDefinition]& assemblies, System.String output_dir, System.Collections.Generic.IEnumerable1[T] sharedCodeTargets) [0x00256] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Target.cs:522
    2> at Xamarin.Bundler.Target.ManagedLink () [0x00720] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Target.cs:669
    2> at Xamarin.Bundler.Target.ProcessAssemblies () [0x000c2] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Target.cs:873
    2> at Xamarin.Bundler.Application.ProcessAssemblies () [0x0002f] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Application.cs:1411
    2> at Xamarin.Bundler.Application.BuildManaged () [0x00001] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Application.cs:839
    2> at Xamarin.Bundler.Application+<>c.b__140_1 (Xamarin.Bundler.Application v) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Application.cs:787
    2> at System.Collections.Generic.List1[T].ForEach (System.Action1[T] action) [0x0001e] in <98fac219bd4e453693d76fda7bd96ab0>:0
    2> at Xamarin.Bundler.Application.BuildAll () [0x00050] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/Application.cs:787
    2> at Xamarin.Bundler.Driver.Main2 (System.String[] args) [0x00423] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/mtouch.cs:1402
    2> at Xamarin.Bundler.Driver.Main (System.String[] args) [0x00015] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/tools/mtouch/mtouch.cs:934

  • HalilDoganBolakHalilDoganBolak USMember ✭✭

    @ColeX something I noticed now at the top of the build output - can this be the reason ?

    2> Connecting to Mac server 192.168.2.3...
    2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Xamarin.Sdk.targets(66,3): warning MSB3491: Could not write lines to file "obj\iPhoneSimulator\Debug\_TelemetryProps". Could not find a part of the path 'C:\Users\HDBolak\Source\Repos\OOVxfAtInvstr\OOVxfAtInvstr\OOVxfAtInvstr.iOS\obj\iPhoneSimulator\Debug_TelemetryProps'.
    2> Connecting to Mac server 192.168.2.3...

  • ColeXColeX Member, Xamarin Team Xamurai
    edited December 2018

    I see the error was related with AWSSDK .

    Try to uninstall it and reinstall via nuget.

  • HalilDoganBolakHalilDoganBolak USMember ✭✭

    @ColeX Unfortunately uninstall and reinstall did not work. Note that the linker complains about not finding the package references of the referenced net standard library and not the references of the iOS app that is using the net standard library. And I have no problems with the UWP app that also uses the net standard library (i.e. my Xamarin.Forms app). Any other things I should try ?

  • HalilDoganBolakHalilDoganBolak USMember ✭✭
    Accepted Answer

    @Colex - I found the problem and since you are part of the Xamarin team I thought you should know.

    If you have a long running Xamarin.Forms project (I do, it is in production for more than two years) you usually have multiple Xamarin.Forms nuget upgrades. And once you have that you end up Xamarin.Forms nuget thrashing the iOS project file. This is what happened. I had to get rid of a stupid app.config file that was created by that nuget; convert all of the references to the new format and then find that there are seven leftover lines in the project file trying to check for some previous version Xamarin.Forms props. Deleting them manually did the trick.

    For anyone reading this, unless you have an explicit reference miss then manually clean your project file. Good luck.

Sign In or Register to comment.