Xamarin iOS error: Can not resolve reference - c#

If I set up a Xamarin.Forms Solution in VS 2013 and try to run the iOS Version, it fails because of the following error:
Error 2 Can not resolve reference: /Users/Koray/Library/Caches/Xamarin/mtbs/builds/WalkiOS/aae389efbebffd5cd3625dcf99aad02c/C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/Xamarin.iOS/v1.0/Facades/System.Collections.Concurrent.dll Walk.iOS
The Xamarin Build Host for Visual Studio is set up and a few weeks ago it worked fine.
I can't find anything to fix the error.

The solution is to update Xamarin on both machines to the same version. It should work fine if you do this.

This can happen if you include a library that's not part of Xamarin.iOS. For example, when you Alt-Enter with ReSharper and it auto-adds a reference it thinks will work, when actually, there's no iOS equivalent of it. This happened to me when I had ReSharper add System.Web. The error looked like System.EnterpriseServices.Wrapper, but the actual error was a non-Mono/non-iOS library being referenced by my project. Unfortunately, the error message is effectively wrong. I hope that helps!
Ybrin's answer is also true. I came across this SO article looking for a different answer, and ended up figuring out this alternative answer.

Related

VS2017 Page is not supported in a Windows Universal project

I have a rather unpleasant problem since yesterday...
I cleared my NuGet chache because I couldn't get a NuGet-Package to work with one of my codes. But it didn't help and instead f***ed up the UWP apps I wrote before that.
I get errors for every element I have in my code like this:
In XAML it's mostly "XXX is not supported in a WIndows Universal project" and in the .cs files its a lot of "Cannot resolve symbol XXX"
How can I repair this?
I can compile and run my code just fine but I can't work with the code when everything gets detected as an error in VS and I can't see my UI while designing it...
I could really need some help here :/
Just putting this here... I had the same problem suddenly.
Updating the NuGet package for Microsoft.NETCore.UniversalWindowsPlatform fixed it for me instantly.
Ok I don't really know why that happend but I found my answer...
I tried restarting VS which didn't solve problem.
I tried restarting my PC which didn't solve problem.
I tried to build my code which didn't solve problembut no errors while building.
I tried to run my code which didn't work but app opens without a problem.
Next step confuses me a bit...
My Code is divided into 2 projects. One for all the XAML files and one for all my code files like Helpers, Converters, Collections...
I opened the NuGet-Manager in the second project and looked for possible updates to my packages. There was an update for the Fody-Package which I installed right away. Now everything seems fine again...even in the XAML project...
I don't understand why it works but it does :/

Error executing task XamlCTask- Xamarin

I am stucking with this error for several days:
/Upackages/Xamarin.Forms.2.3.3.175/build/portable-win+net45+wp80+win81+wpa81+MonoAndroid10+Xamarin.iOS10+xamarinmac20/Xamarin.Forms.targets:
Error: Error executing task XamlCTask:
Could not find file "/Users/XXXX/obj/Debug/XXXX.dll.mdb".
Firstly, I updated the xamarin.forms, but the error was appeared again to me. Then, I clean each project and build it again, but no change has happened.
So, I am wondering what can I do? It has just shown to me since some days ago, before I could compile my project easily.
I had the same issue but using Visual Studio for MAC.
Try doing the following:
Go to "Preferences"
Then look for .Net Runtimes.
I was using: Mono 5.*
I changed my default to Mono 4.* and I was able to build successfully.
NOTE: Make sure that all the packages for Xamarin.Forms are also the same version.

How to fix Error Code CS0433 in Visual Studio 2015

I have a friend who has made some code in visual studio. But when I run his code (after getting it with git), I get Error Code CS0433. The weird thing is another guy on our team can get the exact same code and run it just fine on his computer. Here is a screen shot of the errors:
CLICK HERE FOR A BIGGER PICTURE
What is even more weird, another friend working on a different branch also gets Error CS0433 when running his code. But I can get it and run it just fine on my computer.
I have tried a couple of things to no avail.
Rebuild the solution
Clean solution
Manually deleted bin and obj folders, then do a clean/rebuild
I looked around the web for a solution. I found some people with similar problems, but theirs are in ASP.NET and not .NET. See here and here.
I have also taken a look at the documentation at MSDN on error CS0433. But I'm a beginner find MSDN's explanations very cryptic...
Is there anyone who has an idea as to what is causing this problem and/or a solution on how I can fix it?
If you need additional information feel free to write a comment. I will supply it as fast as I can.
You have references to dotnetcore50, and system.dll. This is causing (I think) most of the problems.
Try removing all the dotnetcore50 references. Start with vanilla .NET and try and migrate to the core libraries slowly. This [blog.marcgravell.com/2015/11/… might help.

In Xamarin getting a failed to resolve System.Runtime.Serialization.XsdDataContractExporter

I've got a cross platform Xamarin app. There's a PCL project, an Android project, and an iOS project. When I build the iOS portion, it complains that "MTOUCH" is having a problem.
Failed to resolve System.Runtime.Serialization.XsdDataContractExporter
reference from System.Runtime.Serialization ...
My Xamarin studio has recently updated to the latest iOS 9 code. Is that related? I also started to use some Newtonsoft.Json code, but I commented out all of the JSON code and it doesn't seem to help.
Any ideas where this error is coming from? I tried googling and I get nothing helpful.
I was having the same issue 2 days ago, but with Android and when I was deploying the application to Release.
Check a few things first:
Go to the Linker Options in the iOS Build properties. If you are in the DEBUG configuration try with the "Don't Link" option and check if it's working fine. In case of RELEASE the recommended option to use is "Link SDK assemblies only".
If the option one didn't work, you could force an specific assembly to be ignored by the Linker, indicating the following in the Additional mtouch arguments field:
-linkskip=System.Runtime
Here's another answer that could help you as well: https://stackoverflow.com/a/30059876/2188509
This is what I did for my Android RELEASE configuration, in case you have the same issues:
I hope this helps.
Regards

Missing project sub type error when trying to create a new MonoGame project

Hello Im using Visual Studio 2012 and whenver I try to create a new MonoGame content project I get this error...Also if I try to start a windows Mono project or a Android mono project I dont get the same error but whenever i try to compile i get errors, i have unstillaed Mono and xamarin and tried installing and that never solved the issue the only thing left to do is uninstall Visual Studio 2012 but that can take a ton of time so if anyone here can help me it will be appreciated here is the link to the following error.
I think I have a workaround for you, although, I still don't fully understand the issue myself and I'd love someone to shed some light on it.
If you open up the project file as plain text you will see a ProjectTypeGuids like so:
<ProjectTypeGuids>{9B831FEF-F496-498F-9FE8-180DA5CB4258};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
If you Google each GUID you will find that one of them is DotNetProjectSubtype id="MonoGame" and the other is Windows (C#).
As far as I can tell you can safely delete the MonoGame one and proceed with your day. I believe it's only used at project creation time.

Categories

Resources