Search code examples
c#androidiosxamarinmonogame

Unable to build mobile MonoGame project because of a "could not import" error


I am making a mobile MonoGame application for the first time but whenever I try and build this error occurs for iOS

Error: /Users/edward/Library/Mobile Documents/com~apple~CloudDocs/apps/Xamarin/Android/Radiant/iOS/Radiant.iOS.csproj: /Users/edward/Library/Mobile Documents/com~apple~CloudDocs/apps/Xamarin/Android/Radiant/iOS/Radiant.iOS.csproj could not import "$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" (Radiant.iOS)

and this error occurs for Android

Error: /Users/edward/Library/Mobile Documents/com~apple~CloudDocs/apps/Xamarin/Android/Radiant/Android/Radiant.Droid.csproj: /Users/edward/Library/Mobile Documents/com~apple~CloudDocs/apps/Xamarin/Android/Radiant/Android/Radiant.Droid.csproj could not import "$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets" (Radiant.Droid)

On the left in the references column, MonoGame.Framework is greyed out and there is a red X next to it


Solution

  • OK I was able to figure it out on my own, I went to the MonoGame addin page and I downloaded the stable release. I then opened up the addin list in Xamarin and I clicked install from file. I selected the stable release I downloaded and then installed it from there. It gave me an error about MonoDevelop but I just ignored it and it worked fine.