Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xamarin Android build failing because of Linking=Sdk Assemblies Only #3237

Closed
HelenMamalaki opened this issue Dec 12, 2016 · 10 comments
Closed
Assignees

Comments

@HelenMamalaki
Copy link

HelenMamalaki commented Dec 12, 2016

I get the an "MSB4018: The "LinkAssemblies" task failed unexpectedly" error when building my Xamarin Android app. I am compiling using the Latest Platform Android 7.0, and Target Android version is the same. I cannot replicate on my local machine.

Full error from build script:
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (1616, 5)
C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1616,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly.
Xamarin.Android.XamarinAndroidException: error XA2006: Reference to metadata item 'Mono.Security.Cryptography.SymmetricTransform' (defined in 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e') from 'System.Core, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' could not be resolved. ---> Mono.Cecil.ResolutionException: Failed to resolve Mono.Security.Cryptography.SymmetricTransform
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.MarkType(TypeReference reference)
at MonoDroid.Tuner.MonoDroidMarkStep.MarkType(TypeReference reference)
at Mono.Linker.Steps.MarkStep.InitializeType(TypeDefinition type)
at Mono.Linker.Steps.MarkStep.InitializeAssembly(AssemblyDefinition assembly)
at Mono.Linker.Steps.MarkStep.Initialize()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
--- End of inner exception stack trace ---
at Xamarin.Android.Diagnostic.Error(Int32 code, Exception innerException, String message, Object[] args)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
Process 'msbuild.exe' exited with code '1'.

@yacaovsnc
Copy link
Member

yacaovsnc commented Dec 13, 2016

Thank you for reporting this issue. We are working on updating the hosted build VM to work with latest Xamarin Android.

Duplicate of #3191.

Update: sorry after reading the issue a little bit more, I see the two issues report different exceptions. While updating the build VM may solve the issue, I will leave both open and track as separate issues for now. Thanks.

@madhurig
Copy link
Contributor

The Linker error you are seeing is due the hosted build VMs not having Xamarin.Android 7.0 support though the Android SDK 24 is installed. We will be updating them early next year after the holidays.
I see this other issue xamarin/app-crm#110 which was resolved by targeting 6.0 as well.

Thanks,
Madhuri

@shortstuffsushi
Copy link

@madhurig could you please add a comment noting why you close issues in the future? By digging through linked issues, I saw that it was fixed, but it's not clear in this issue.

@madhurig
Copy link
Contributor

@shortstuffsushi : Sure. The hosted build VMs were updated with Xamarin.Android 7.0 support in the last week of December.

@shortstuffsushi
Copy link

@madhurig in this instance, I already saw it. I mean to say, in the future, please provide context when closing an issue for those of us watching.

@danieljaguiar
Copy link

@madhurig I am getting this error now. Does this one came back? I am using 7.1...

@madhurig
Copy link
Contributor

@danieljaguiar: We were tracking this issue for Android 7. If you are seeing an issue with 7.1, please open a new issue with the build logs.

@anobik
Copy link

anobik commented Mar 29, 2018

Now I am facing this issue

Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Linq.ParallelQuery`1 System.Linq.ParallelQuery::Cast()' in assembly: 'System.Core.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverageAttribute::.ctor()
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkCustomAttribute(CustomAttribute ca)
at Mono.Linker.Steps.MarkStep.MarkCustomAttributes(ICustomAttributeProvider provider)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessEntireQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, ILogger logger, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

VS 2017Enterprise
Android 7.1
Dot Net Framework 4.6.2

Please suggest a way out.

@madhurig
Copy link
Contributor

@anobik: This issue is a year old. Please open a new issue.

@anobik
Copy link

anobik commented Mar 29, 2018

@madhurig already raised one

#6834

Please let me know if any more details required.

Thanks,
Anobik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants