Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error building Xamarin.Android project using Xamarin.Studio

I'm using the latest stable version of Xamarin.Android and Xamarin.Studio. When I try to build an android project I'm getting the following error:

/Library/Frameworks/Mono.framework/Versions/4.0.3/lib/mono/4.5/Microsoft.CSharp.targets: error : Tool executable '/MSBuild/14.0/Bin/mcs.exe' could not be found

How can I diagnose and fix the issue?

like image 834
Alexey Strakh Avatar asked Aug 16 '15 23:08

Alexey Strakh


People also ask

Does Xamarin require Android studio?

To use the Xamarin Android SDK Manager, you will need the following: Visual Studio 2022 Community, Professional, or Enterprise. Visual Studio 2019 Community, Professional, or Enterprise. OR Visual Studio 2017 (Community, Professional, or Enterprise edition).

Can not resolve reference Xamarin?

If you are facing this issue in Cross platform application with Xamarin. Forms version above 3.2, check whether any Android support library packages are installed. If installed, kindly uninstall those support library packages and set the Target Platform to 9.0, clean the project and build it again.

Is Microsoft replacing Xamarin?

NET MAUI (. NET Multi-platform App UI) is now a project type among the five Desktop & Mobile options in Visual Studio 2022 17.3 Preview 1, replacing the Xamarin-based option. . NET MAUI is described by Microsoft as the evolution of mobile-centric Xamarin.

Will Xamarin be discontinued?

In May 2020, Microsoft announced that Xamarin. Forms, a major component of its mobile app development framework, would be deprecated in November 2021 in favour of a new . Net based product called MAUI - Multiform App User Interface.


1 Answers

I had this problem after trying to use C# 6 features in Xamarin studio on Windows.

In my case I had added the following to my project file:

<PropertyGroup Condition="'$(Platform)' != 'Unix'">
  <CscToolPath>$(MSBuildProgramFiles32)\MSBuild\14.0\Bin</CscToolPath>
</PropertyGroup>

which worked fine on Windows, but gave me the error you had, when I tried it on a Mac. It should have been:

<PropertyGroup Condition="'$(OS)' != 'Unix'">
  <CscToolPath>$(MSBuildProgramFiles32)\MSBuild\14.0\Bin</CscToolPath>
</PropertyGroup>

There is some discussion here: http://forums.xamarin.com/discussion/42919/how-do-i-tell-xamarin-studio-to-use-a-specific-version-of-msbuild-when-i-have-multiple-versions

like image 180
GalaxiaGuy Avatar answered Sep 23 '22 15:09

GalaxiaGuy