Visual Studio For Mac - Cannot build Android

The error:
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(5,5): Error MSB4018: The "ResolveAssemblyReference" task failed unexpectedly.
System.InvalidOperationException: PE image does not have metadata.
at Microsoft.Build.Tasks.ReferenceTable.SetPrimaryItems (Microsoft.Build.Framework.ITaskItem[] referenceAssemblyFiles, Microsoft.Build.Framework.ITaskItem[] referenceAssemblyNames, System.Collections.ArrayList exceptions) [0x00021] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Tasks/AssemblyDependency/ReferenceTable.cs:496
at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure (Microsoft.Build.Tasks.DependentAssembly[] remappedAssembliesValue, Microsoft.Build.Framework.ITaskItem[] referenceAssemblyFiles, Microsoft.Build.Framework.ITaskItem[] referenceAssemblyNames, System.Collections.ArrayList exceptions) [0x00012] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Tasks/AssemblyDependency/ReferenceTable.cs:1633
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute (Microsoft.Build.Shared.FileExists fileExists, Microsoft.Build.Shared.DirectoryExists directoryExists, Microsoft.Build.Tasks.GetDirectories getDirectories, Microsoft.Build.Tasks.GetAssemblyName getAssemblyName, Microsoft.Build.Tasks.GetAssemblyMetadata getAssemblyMetadata, Microsoft.Build.Shared.GetRegistrySubKeyNames getRegistrySubKeyNames, Microsoft.Build.Shared.GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue, Microsoft.Build.Tasks.GetLastWriteTime getLastWriteTime, Microsoft.Build.Tasks.GetAssemblyRuntimeVersion getRuntimeVersion, Microsoft.Build.Shared.OpenBaseKey openBaseKey, Microsoft.Build.Tasks.GetAssemblyPathInGac getAssemblyPathInGac, Microsoft.Build.Tasks.IsWinMDFile isWinMDFile, Microsoft.Build.Tasks.ReadMachineTypeFromPEHeader readMachineTypeFromPEHeader) [0x00556] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Tasks/AssemblyDependency/ResolveAssemblyReference.cs:2182
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Tasks/AssemblyDependency/ResolveAssemblyReference.cs:2903
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00023] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Build/BackEnd/TaskExecutionHost/TaskExecutionHost.cs:632
at Microsoft.Build.BackEnd.TaskBuilder+d__26.MoveNext () [0x00249] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/msbuild-15.0/src/Build/BackEnd/Components/RequestBuilder/TaskBuilder.cs:787 (MSB4018) (Platform.android.fsharp)

Diagnostic logs attached.

Posts

  • JGoldbergerJGoldberger USXamarin Team, University Xamurai

    The error would seem to indicate that some referenced assembly does not have any metadata. What assemblies are you referencing from your Android project?

Sign In or Register to comment.