trololol
trololol

Reputation: 19

Getting started with Xamarin Forms App

I've been trying to get Xamarin studio to create a new forms project on OSX for me with no success.

I selected Files>New Solution>C#>Mobile Apps>Blank App and sure enough the project gets created. Lets call this project MVVM for now. There is one folder called MVVM for the unified codebase, one folder called MVVM.Drvoid, one called MVVM.iOS. In its untouched state, neither builds work.

When building for iOS, a warning pops up with "warning MT0030: The executable name (MVVM.iOS) and the app name (MVVMiOS.app) are different, this may prevent crash logs from getting symbolicated properly." I tried the solution listed here but it doesn't work.

As for android, there is no build option even set up. The only way to run it is to manually right click on MVVM.Droid folder, select build, then select run.

It confuses me to no end to think why Xamarin would not set up their sample projects properly. Does anyone know what I am doing wrong? Or what should I do to get a functional forms application set up?

Upvotes: 0

Views: 237

Answers (1)

Curtis
Curtis

Reputation: 5892

WELCOME TO MY WORLD !!!!

Sorry, had to yell out that last statement.. I whole-heartedly agree with you. The Xamarin team for some reason doesn't make an easy out of the box template that generates your project in a usable way. I think they all code on MACs and don't code on PCs with Visual Studio 2013... (or maybe they need a few more QA folks to test the 'starting from scratch' scenarios and make sure that their documentation and the actual way you create a project are in sync with each other.

Anyway, I have been having the same problem. One thing to try is to update all your Xamarin stuff on your PC and on your MAC if you're using both. Also, make sure you have the very latest NuGet. Then update all the NuGet packages. Make sure the NuGet package for Xamarin.Forms has been added to all projects in your solution. I also have the following nuget packages, but your project may vary based on what features you use: Microsoft Async, Microsoft BCL Build Components, Microsoft BCL Portability Pack, PCL Storage - Portable Storage APIs, and of course Xamarin.Forms.

Double check for available NuGet updates for all the packages you have installed. Seems like they're updating something or other every few days...

Under your Xamarin.Forms common project, click Properties and select Library. Make sure the Target frameworks is set to the correct one. Click the 'Change...' button and checkmark all Target Frameworks except 'Silverlight 5'. Then click 'OK'.

Go and double check your .ios project settings and make sure all the necessary fields are filled in. (Application Name, Identifier, Version, Build, Deployment Target...)

Also, after it creates the solution for you, delete the WindowsPhone and Android projects it generated.

Hopefully one or more of the above tweaks will get your project building. It's a royal hassle and Xamarin should really try to make this a bit more seamless.. It is quite surprising all the hoops you need to jump through to get a simple Xamarin.Forms 'Hello World' app working.

Best of luck !!!

Upvotes: 1

Related Questions