Unable to create Xamarin project - c#

I am a new Xamarin user, and have installed the Visual Studio 2015 Community installation, with all the Xamarin options enabled. This was done on both a Windows 8.1 and Windows 10 machine, both of which were fresh installations.
On both PCs, I am receiving the same exact errors. As soon as a Xamarin.Forms.Portable project is created, it loads with the following errors:
I have tried reinstalling Visual Studio multiple times, and made sure to install all features. I also tried the steps highlighted here, to no avail.
I do not know how to proceed. I am new to Xamarin, and need to create an application which works on both Android and iOS devices, so from what I can see, this is the project type I need to choose.
Is there something which I have missing, that needs to be installed? These errors are appearing as soon as a new project is created, so I'm assuming that the default configurations should be fine.
I also tried adding Xamarin.Android.Support.V4 through NuGet, however this in turn caused more errors.

These all appear to be warnings, not errors. You should still be able to deploy to emulator or device.
The XamlCTask errors are probably related to the fact that, annoyingly, the versions of Xamarin Forms nugets are not aligned across the different platforms with a clean installation of VS2015 Community. Right click on your SOLUTION, go down to Manage Nugets for Solution, and update Xamarin Forms. I was fighting these warning for a long time before figuring that out.
Do NOT update all Nugets -- packages are being pushed that are incompatible! This was true recently in the Android universe -- updating all Nugets to latest stable would break your app. This appears to be resolved now (I'm at the latest stable in all categories with working projects) but be mindful that you may need to roll back to "minimum required" rather than "latest stable" if you have errors. A new issue has come up with the latest Xamarin Forms and 3rd party Nugets creating troublesome Resources.cs errors.

Related

Visual Studio C++ project on another PC fails to build

Tested with the following setup:
Home - VS2017 or VS2019
Classroom - VS2013 or VS2015.
I do code at home, then copy to my flash drive, bring it to the classroom and open a project from their PCs. Upon compilation I receive a big list of errors accessing standard header files, similar to this. Happens to me with every project I create at home, and the other way around: from the classroom to home PC.
This is something that doesn't happen with C# projects, which only ask me to change the .net framework version before opening, everything works fine here.
If you created a project in VS2013 and try to open it in VS2017 or VS2019 you might need additional changes.
Check this out- https://learn.microsoft.com/en-us/visualstudio/porting/port-migrate-and-upgrade-visual-studio-projects?view=vs-2019
If you created a project in the latest version say VS2019, it is very difficult to open it in older versions such as VS2013.
To fix it set the Omnipath to latest in vscode settings

How to clone a Xamarin Project and have it build right away

I am working on a project on my laptop, and am switching laptops. It is a Xamarin Android project with C#. It is source controlled onto visual studio online / devops using the Git option. When I clone my project onto my new laptop. My project is not building. Some projects aren't loading and some of my references have errors next to them.
I think to get it working requires some necessary steps. Please tell me if any of this should not be necessary.
(1) Open Visual Studio Installer and Modify in order to add Mobile Development and .Net so that Xamarin is installed.
(2) Tools > Android > Android SDK Manager > Checkmark necessary SDKs (aka android Lollipop, etc). (If these are failing, then right click on visual studio icon to "Run as Administrator" when initially opening.
This third step is whats bothering me:
(3) Clean Solution and Rebuild. And magically every dependency and every necessary anything is automatically installed/etc.. but not true.
Instead...
Some references in your projects will have a yellow triangle icon. Go to Tools > Nuget Package Manager and when you select any of the Installed projects, there will NOT be a checkmark next to ANY projects.. weird.. but when you go to Update, and click on any needing an update, the checkmark will be there. If you select all and update, some of your yellow triangles will go away, but the checkmarks won't appear in Installed when clicking on a project and seeing which projects it is installed in on the right.
Is there some button or command I am supposed to run that will grab all the necessary dependencies for me? Instead of me having to dig around and still have a non working solution?
Can you give some examples of the error messages you are getting? Usually Project Load - Restore Nuget Packages - Clean & Rebuild works for me.
NuGet will download the packages available in the package manager. However it may happen that some packages where not installed through the sources available in the package manager or that those packages are not available anymore.
In order for all the projects to build correctly I believe the following order is necessary: (As OP, I downloaded and tried to build the project before checking to make sure I had Xamarin and the necessary SDKs, and once those were installed, it wouldn't fix the project without deleting and recloning)
(1) Do NOT clone your project from github/devops yet. Delete it if you have.
(2) Install Xamarin. Open Visual Studio Installer and Modify in order to add Mobile Development and .Net so that Xamarin is installed.
(3) Install necessary SDKs for Android OS version. Tools > Android > Android SDK Manager > Checkmark necessary SDKs (aka android Lollipop, etc). (If these are failing, then right click on visual studio icon to "Run as Administrator" when initially opening.
(4) Clone project from github/devops, and clean/build. Should work automatically.
(An aside: I feel like step 3 should also be automatic? It should know which ones I'm targeting and auto install those? Maybe it does, I'm not sure.)

Xamarin Studio Won't Allow Click for Next button

I have the SDK manager for Android installed and updated on my PC currently running a Windows OS And i also have Xamarin Studio downloaded and installed for Windows.
Challenge is, i try as much as possible to create a new "Helloworld" project and the Next button has bluntly refused. What could be the issue really? I am Totally new to this
The only solution that could come thru at this Moment was installing a lower version of Xamarin. I installed http://download.xamarin.com/studio/Windows/XamarinStudio-5.9.5.9-0.msi as the community version and it didnt give issues installing and no grey out buttons in this case, Thought I'd post the answer here

UWP Project not loaded (Update Required)

I'm facing an annoying problem involving my installation of Visual Studio 2015 Enterprise. I just got into a cross platform mobile project and I have fetched the source code from version control. The solution consists of several mobile projects (Android, iOS) that work fine and a UWP project that refuses to load. It says on the solution explorer:
This project requires a Visual Studio update to load. Right click on the project and choose "Download Update"
After clicking "Download Update" I'm presented with this page: https://developer.microsoft.com/en-us/windows/downloads/sdk-archive .
I've tried downloading all three of the SDKs (I don't think it's an emulator issue so I haven't bothered download the emulator installers).
All three throw this error:
I've tried modifying my Visual Studio installation from the control panel but as you can see the installer claims all Windows SDKs are currently installed:
I've tried re-installing the SDKs. I've tried reinstalling Visual Studio 2 times, one of them involved a full uninstall by running
vs_enterprise.exe /uninstall /force
in a command prompt but to no avail.
Also when I try to create a fresh UWP Project the only platform I can target is the 10.0.240 build. I recall being able to target other versions in the past but the dropdown only contains this option now.
I finally solved it after quite a lot of research. I followed these steps:
Go to Control Panel > Programs & Features
Find Microsoft Visual Studio 2015, right click on it and select 'Change'
When the installer pops up select 'Modify'
Uncheck the whole 'Universal Windows Apps Development tools' section
Wait until the uninstallation is complete
Restart
Again go to Control Panel and find the SDK installers which apparently are not removed using the above method:
Uninstall them all
Restart
Visit this page: https://developer.microsoft.com/en-us/windows/downloads/sdk-archive and download all three SDKs
Start by installing version 10.0.26624 and work your way up
After you're done go to control panel find the Visual Studio Installation, right click, click 'Change' then after the wizard loads select 'Modify'
Make sure every option in the 'Universal Windows Apps Development Tools' section is checked, click Next
After the installation of the SDKs and tools is complete restart your computer
The error should be gone now
I ran into this error trying to add a Portable Class Library project to a solution. It occurred whether I asked it to target Windows Universal 10.0 or Windows 8.1.
The workaround I used is to ask it to also target ASP.NET Core 1.0, even though I wasn't using ASP.NET.
I also ran into this which took me a lot of time to solve. Actually YOU DON'T HAVE TO REINSTALL ANYTHING! If you are totally sure your Visual Studio is up to date, just follow these steps and it will solve your problems: https://stackoverflow.com/a/35733823/3322347

Visual Studio 2010 going crazy with silverlight projects

I tried to create a new Silverlight project in Visual Studio 2010 (Ultimate version) for the first time.
It told me I got to install the latest version of Silverlight, before creating any.
You need to install the latest silverlight developer runtime before creating a silverlight project
I clicked the link on the message, download and install whatever was there.
Then when I tried to create a new project, it told me I got to install "Silverlight 3 sdk".
I removed the new version, and installed Silverlight 3 sdk.
Then again, when I tried to create a new project I recived the error stating I must install the latest version.
It went like this a bit more, then after searching on the internet, I removed everything from my computer with "Silverlight" in it's name, installed Visual Studio SP 1, reinstalled Silverlight 5 (this time I paid attention to install x64 version, since it turns out that in the error message Microsoft supplied a link to x86 version, no matter what OS you are running).
I managed to create a new project, and everything was fine.
Then I downloaded some Silverlight.FX samples (probably for version 3).
They weren't open properly (which was a downer by itself), and then I recieved again a message tells me I must istall the newest version.
I closed Visual Studio, tried to create a new project, and got again the same message.
It seems the problem reappeared just because I opened an old project.
Does it make sense? Why my Visual Studio is so unstable? What should I do?
Your silverlight plugin version, silverlight sdk and silverlight developer tools version should be same version. Please check this.

Categories