I'm a mac developer trying out xamarin. I first tried Xamarin.Mac, but found that there was barely any support on that, so I added in Xamarin.Forms by adding some code and importing a NuGet package.
I'm using xcode for UI design and Visual Studio Mac 2022 for this, but whenever I try to run it throws the error 'xamarin/xamarin.h' file not found. I don't have a xamarin.h file, and don't know how to create one.
Related
I have been trying to build a simple installer from a newly created template from Visual Studio for Mac.
New Project > Cocoa App
Nothing fancy really.
I can run the app in debug mode, but as soon as I enable the Create Installer Package option, it won't build.
Options > Build > Mac Build > Packaging : Create installer package (checkbox)
I always get this error:
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac/Xamarin.Mac.Common.targets(3,3): Error MSB6006: "productbuild" exited with code 134. (MSB6006) (InstallerAttempt01)
I am using the latest Visual Studio Mac, and the latest Xamarin.Forms versions.
So, I must be missing something, and I don't really know what right now, as I can't find any info on this topic anywhere.
Just to confirm that this is a bug, me and one more developer have confirmed it.
You can upvote or comment here so that it may be fixed quicker: https://github.com/xamarin/xamarin-macios/issues/13197
Update: Apple is expected to fix this problem in the new version of macOS/XCode
I was trying out MonoGame. I installed the MonoGame add-in, and then created a new Universal Project. Looked good.
Then I noticed that both the Mac and Android projects created had bad references to a MonoGame assembly. Some googling revealed this is a known issue, and I was able to remove the bad reference and add the correct one.
But now when I build, I get an error:
Error: /Users/davevr/Documents/github/MonoTestGame/iOS/MonoTestGame.iOS.csproj could not import "$(MSBuildExtensionsPath)\MonoGame\v3.0\MonoGame.Content.Builder.targets"
I can't find these files anywhere on my machine so I am not sure what the issue is.
Any help would be appreciated!
Did you install the MacOS download?
http://www.monogame.net/2016/03/17/monogame-3-5/
It should install those targets to your machine. It might also be possible that the project templates are old and do not correctly reference the right paths.
When I create a new project in Xamarin.Forms I get a lot of errors in the UWP part of the project.
It looks like I miss all the referencs in UWP?
I installed Xamarin trough Visual Studios modify
Below is a screenshot of my Visual Studio
I also started to work with Xamarin about two weeks ago and came across many problems and one was just like yours. If you dont have Xamarin studio go and download it. Just do it.
Intellisense breaks really often and you get 200 errors that are dump(or not).
To get rid of the errors there are many ways.
Sometimes you just have to wait.
Open the xaml pages and save them.
Clean - rebuild the project it should run(at third try). If it doesnt you have to open Xamarin studio and built it from there.
If your project is new, just delete it and create a new one.
If you have MVC 5 or Core 1 Installed you will have to remove them(if that doesnt help do a PC Reset like a format).
If it says something for .zip files, find them keep a backup and delete them. Xamarin will re-download on Build.
I had same problem here using Visual Studio 2015 Update 2. Unload the UWP and everything works.
Tried in Xamarin Studio Professional and the following error: -
Could not load project 'blah\blah.UWP\blah.UWP.csproj' with unknown item type '{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A}'
The following link has some helpful points and mentions "UWP is available in Xamarin.Forms 2.1 and later"
https://developer.xamarin.com/guides/xamarin-forms/platform-features/windows/installation/universal/
The default setup when creating a new project in VS 2015 Up2 is to use Xamarin Forms v2.0.0.6482, however when I try to update to v2.1.0.6529 I get nuget errors
Checking my output when trying to update to 2.1 using nuget i got the following: -
The content at 'https://{myteamcityserver}/guestAuth/app/nuget/v1/FeedService.svc/FindPackagesById()?id='Microsoft.NETCore.UniversalWindowsPlatform'' is not valid XML.
Root element is missing.
So I turned of my local Package Source in Tools | NuGet Package Manager | Package Manager Settings | Package Sources
And woo hoo it all worked for me.
Regards
Peter
I recently tried to open the solution file (.sln) of my iOS-App and noticed it no longer works with Xamarin Studio.
The error message: Cannot cast from source type to destination type.
I've been using MSVC 2010 for app developement recently, so I guess this is another example of incompatibilities between Xamarin Studio and MSVC (I'm already used to messed-up "ItemGroups" in the .csproj files, but this seems to be something different).
The version of Xamarin Studio is 5.9.8 (build 0).
Maybe I should also file a bug at Xamarin.
Deleting the .userprefs file solved the problem.
Details:
The root element contained a strange value for "DisabledProjects":
<Properties DisabledProjects="
">
Xamarin Studio failed to load that expression. Don't know where that came from though.
Just playing with Xamarin.Forms, downloaded sample project TipCalc from here. When I try to open the solution in Xamarin Studio I am getting this error.
When i try to build the project, i get this error
Error MSB4019: The imported project "C:\Program Files
(x86)\MSBuild\Microsoft\Portable\v4.5\Microsoft.Portable.CSharp.targets"
was not found. Confirm that the path in the declaration is
correct, and that the file exists on disk. (MSB4019) (TipCalc.Android)
Please someone guide me, what should i configure in my project, to make this to run successfully. I am using Xamarin Studio 5, my OS is windows 7 ultimate.
I installed Portable Library Tools followed by Xamarin.Android to fix this. This error occurs if we try to load the pcl project without installing portable library tools, because Xamarin checks for following file in the machine while loading pcl project.
C:\Program Files
(x86)\MSBuild\Microsoft\Portable\v4.0Microsoft.Portable.CSharp.targets