Apps

Setting up your Xamarin development environment in Visual Studio

Apps, Software Development, Xamarin

I’ve been developing apps using C# in Xamarin for a number of years now, up until now as a side project but as Xamarin was bought by Microsoft earlier this year and the annual license is now free it seemed the right time to start focusing on Xamarin a little more.

In order to develop apps using Xamarin you have to decide whether to develop on a PC or a Mac primarily, and then get your overall system set up and running. My setup of choice was to do all my coding on my PC in Visual Studio 2015 and use my Mac Mini on the same network to run my IOS simulators on, and connect my IOS test devices to. It’s important that the installed SDK versions for Xamarin match on both the PC and the Mac or you can run into compilation or deployment problems down the line.

During the process of getting all of this setup, and up to date I ran into a number of issues which, from the Google searches I did, seems I’m not the only person to have these problems. I’ve collected a rough and ready list of some of the errors and their solutions to hopefully save others a bit of the time it took me to eventually get to a stable working system.

During this process you may need to know a couple of key things –

1. Find the IP address of your Mac on the network
2. View your Xamarin log files
3. Update the Xamarin and XCode installs on your Mac
4. Update the Xamarin and SDKs on your PC.

This post will help you do each of those, and if you still haven’t got up and running by the end of this post you can turn to both the Xamarin forums and Stack Exchange for help.


Find the IP address of your Mac on the network

In the top right hand corner of your Mac screen you’ll see the little Wifi symbol that shows your Mac is connected to a Wifi network – click on this symbol while holding down the Ctrl key on your Mac and you’ll see some extra info appear in the dropdown list, inlcuding the IP adress of your Mac on the network.

Xamarin setup process and common error messages

Typically at some point you’ll have a problem getting your PC to connect to your Mac – this wouldn’t be a problem in itself apart from the fact for some reason the useful error messages are hidden deep within the Xamarin log files. Incidentally it’s vital that your PC and Mac are on the same Wifi network…. I had issues at one point because my laptop had autoconnected to a BT Openzone Wifi network and the Mac was on the normal office one. Just a simple point that’s easily overlooked. Presuming it’s not that, you will need the log files! Using the instructions below to get to the log file you are likely to find a message like:

“The installed Xamarin.iOS (version 10.0) on the Mac macname.local (192.168.x.xx) is not compatible with the local Xamarin.iOS 10.2.”

Which is just telling you to update whichever systemis behind and then you will be able to connect to your Mac no problem..

1. Error occurred in the designer agent. Object reference not set to an instance of an object – designer won’t load. Can happen for a number of reasons, in my case when I went on to my Mac and opened XCode / Apple developer account there was a license agreement dialogue box that needed to be accepted by me. Once I’d done that everything worked fine.

2. Failed to create the a fat library. The solution to this was to go to the Mac and open Xcode. An update had been installed and it was waiting for me to accept a new user agreement. Once I’d done that and returned to Visual Studio on the PC I could build the project no problem.

Xamarin related updates

There’s a series of places that updates need to be ‘triggered’ when you’re using Xamarin – the PC, the Mac, and if you are debugging on a device, then the device environment itself.

Updates are located in Visual Studio on the PC. On the Mac there’s system updates which might include Xcode, that needs to be kept up to date. You’ll also have Xamarin Studio installed on your Mac, and that has an updater that will need to be run as well by clicking the File > Check for updates button.

On your device you need to go to follow the normal process for updating your version of IOS (I’m only developing on Apple devices at he moment until I’ve got more comfortable with the full development cycle).

Diagnosing problems and using the Xamarin log files

The log files can be located by going to Help > Xamarin > Open Logs in Visual Studio and then browsing to the relevant folder location as follows:

Mac – ~/Library/Logs/Xamarin-[MAJOR.MINOR]
Windows – %LOCALAPPDATA%\Xamarin\Logs (on Windows 10 this will be something like C:\Users\Bob\AppData\Local\Xamarin\Logs)

If you don’t see the folder you may have to tell File Explorer to show hidden files as they could be hidden by default.

Also in Visual Studio pay close attention to the output window. Top left of that window is a dropdown that says ‘Show output from ‘ and then there are several options:

– Build
– Build order
– Debug
– Xamarin
– Diagnostics

You find different type of information in each and they are often worth trawling through if you are encountering problems.

My next Xamarin post will relate to some of the initial stumbling blocks I encountered when building my first Xamarin app.

The Best Weather Apps For iPhone & iPad – That We Know Of!

Apps

With all this hot weather – and the possibility of a spanish plume and big thunderstorms forecast for the next few days – I thought I’d put together a review of what I think are the best weather apps for iPhone. Being a storm lover, and loving interesting weather of any kind there are a few weather apps I’ve found myself relying on a lot ever since I got my first iPhone.

So what are the best storm tracking apps? And what are the best general weather apps for iPhone or iPad? Note – I’m not reviewing Android weather apps because I don’t have an Android and believe they vary a fair bit from the iOS version.

1. Weather Pro App – FREE & £1.99 Pro Version

Weather app for iphone - Weather ProMy favourite, and certainly the weather app I use the most, has to be the Weather Pro app. This is my go to app for general weather. the free version is really good but I’d definitely recommend upgrading to the paid version to get detailed radar, 2 weeks forecasts and more extras. The app includes a live lightning tracker, rain / snow / hail forecasts, and the weather forecasts themselves are super accurate. I quite genuinely can’t imagine life before this app!

2. Home And Dry Weather App by MetDesk – £1.49

Best weather apps review - Home and Dry appThis has absolutely fantastic animated maps and a brilliant user interface. It feels slick and easy to use and combines real radar data with forecast rain data to give you an all in one animated weather map. It’s a useful app when there are heavy showers about and you want to know if you’re about to get wet or not!

3. Dark Sky Weather App – £2.49

iphone weather app dark skyOne of the two most expensive weather apps I’m recommending but this is a really fantastic piece of user interface design and a couple of unique features which make it a top pick. Notably it includes a customisable alert setting where you can ask the app to sound an alarm shortly before rain (or snow) is about to arrive at your location. You can even adjust it to only alert you when the rain is heavy, rather than moderate or light. I’d like to see this expanded to thunderstorm alerts. It also includes a mesmerising animated radar map – on a globe which you can rotate, and zoom in on.

4. Forecast.io – £0.79

forecast.io iapp weather app for iphoneA beautifully designed app, especially the elegant animated icons. But I’ve found the actual forecasts to not be quite as accurate as our other apps so I’d recommend having a look at this weather app but don’t rely on it for deciding whether to plan a BBQ this weekend! This one actually feels very similar to Dark Sky – if anyone has any info on if these are related I’d love to know.

5. BBC Weather App – FREE

Weather apps for iphone - BBC Weather AppThe BBC weather app feels BBC, looks BBC and delivers reliable BBC forecasts. Sometimes wonderfully detailed and accurate – sometimes a shade off the mark but a great one to rely on and after all it’s FREE! It’s missing two things for me, an animated radar, probably the most useful bit of any weather app, and weather warnings should be delivered as push notificatioons too. One other thing, I’d also love to see the weather symbols fall off the screen occasionally. Or am I showing my age saying that?!

6. Met Office Weather App – FREE

Met office app for iphoneThe Met Office weather app is appealing from the point of view it offers a unique interface compared to the other weather apps, includes localised weather alerts built in (as long as you have push notifications switched on) and is accurate, as you’d expect. From a personal point of view I don’t like the radar as much as our top two – it doesn’t feel as slick and zooming in feels awkward so when I’m trying to figure out if I should walk or drive to the park with the kids today I don’t rely on this app. I also don’t find the user interface quite as intuitive as some of the others. Defintely has it’s uses though and worth a look.