Forum Visual Studio

Nagging compile error on Visual Studio for Mac

GuyProvostGuyProvost CAMember ✭✭✭

Strange compilation bug. When I clone my repo on a Mac and compile my Android solution, I get a "Unknown MSBuild failure". When I click on the error message, Visual Studio for Mac points to the first line of the Android csproj file.

As if the problem was xml related, like corrupted file.

When I clone the same repo on my Windows PC, the project compiles just fine.

Any pointers on where to look at ?

Note that I also have a warning I can't get rid of and may be related to this error ? The warning complains about : Could not locate the assembly "Mono.Android"

Which I find rather strange since it's Android app that ran without any problem and being compiled succesfully the last 3 years! The error on the mac is there since I've recently recloned the repo!

Note also that this is a Xamarin Forms App and I run the app on the 4.8.1 runtime because a have legacy stuff on the app that isn't supported on 5.X. Should I reinstall Xamarin.Android for that specific runtime ? If so, where can I get it ?

The build output ends like this :

Build succeeded.

/Library/Frameworks/Mono.framework/Versions/4.8.1/lib/mono/msbuild/15.0/bin/Microsoft.Common.CurrentVersion.targets(1980,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "Mono.Android". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
    1 Warning(s)
    0 Error(s)

Time Elapsed 00:00:13.24

---------------------- Done ----------------------

Build: 1 error, 1 warning

As if everything was ok and then BAM!

Any pointers where to start ? I've uninstalled VS for mac and reinstalled it to no avail!



Sign In or Register to comment.