Tag: Visual Studio

Programming Stuff

Xamarin Build Server – The Pin You Entered is Invalid

If you’ve recently updated your Mac to Yosemite, you may be having trouble connecting Visual Studio to the Xamarin Build server.

You know you’re entering the connection pin correctly but you keep seeing the error message…

The Pin You Entered is Invalid

Don’t worry, you’re not crazy … It turns out that changes to the network stack in the Yosemite edition of OSX are causing problems in the communication between Xamarin within Visual Studio (running on Windows) and the Xamarin build server (running on OSX).

The Good News: The solution is simple…
Update Yosemite to the latest version, restart Visual Studio and the Xamarin build server and then all should be well.

For more detail on what happened, checkout this discussion of the issue over at Xamarin.

 

Programming Stuff

Cross Platform iOS/Android with Visual Studio and C# (Xamarin) Series Complete

I’ve been working with Xamarin a great deal the past several months and am increasingly becoming a fan of the product. The ability to leverage the Visual Studio IDE,  familiar .NET class libraries, and C#programming language to create both Android and iOS apps provides incredible power.

Xamarin_iOS_Android

The beauty of working with Xamarin is that it allows us to share code when doing so makes sense but Xamarin also embraces the unique features of each platform. Xamarin does this by going beyond the many .NET classes that we’re all familiar with to also include .NET classes that expose the features of each platform.

As an example, the features of Android activities are available through a .NET Android.App.Activity class. Similarly, there’s a .NET MonoTouch.UIKit.UITableViewController class that makes the iOS UITableViewController features available. The platform-specific features provided by Xamarin are extremely rich and comprehensive giving us access to most any platform features we’re likely to use.

By having both the standard .NET classes and platform-specific .NET classes we’re able to build our application’s core logic just once, sharing that logic across both platforms, while also having full access to each platform’s unique capabilities and features.

If you’d like to learn more about working with Xamarin, I encourage you to checkout my 2 part course series on cross-platform app development with iOS and Android. Pluralsight just published part 2 of the series this week.

CrossPlatformiOSAndroidVSCSharpPart1_WithLogo

CrossPlatformiOSAndroidVSCSharpPart2_WithLogo

BTW: Although the 2-part series on cross-platform iOS/Android development with .NET/C# is complete there’s still a lot more to content to come. Keep watching for more courses on using Xamarin to create Android and iOS apps.

Programming Stuff

iOS/Android/VisualStudio/C#/Xamarin – Getting a Working iOS Build

I’m happy to report that since my previous post, I am now able to build the iOS app without any difficulty. Thanks again to James Montemagno at Xamarin for his help.

BTW: My apologies for the 4-day gap between posting on the issue. I was out of town and didn’t have my Mac with me so couldn’t do the iOS part of the build.

The reason I encountered errors & warnings when building the iOS project is due to the fact that when the wizard generates the project it does not fill in 3 key fields in the project properties: Application Name, Identifier, and Version. The fields are all blank as shown here.

iOSAppProperties

I filled those in with the appropriate values as shown here…

iOSAppPropertiesCompleted

… and all builds well.

One bit of frustration is that I didn’t see anywhere in the Xamarin Hello, iPhone documentation where it said I had to fill these values in for a valid build.

Near the end of the documentation it does mention that one can edit the plist file using property pages. However, the screen shot shows the Identifier and Version fields empty giving one the impression that leaving them blank is OK.

With those values being so important, I would’ve preferred that Xamarin did one of the following (listed in my order of preference).

  1. Prompt for the values in the project wizard
  2. Default the fields to some reasonable value

In fairness, the error/warning messages do indicate that the values need to be set on the property page. It’s just that after the other headaches I was experiencing, seeing an untouched, wizard-generated project fail to build left me a bit discouraged.

IMHO – When working with a brand new environment, its critical that what comes out of the wizard must build without any errors. So often all one is trying to do is verify that the pieces are working and build errors on untouched wizard-generated projects give one the impression that something is wrong. 🙂

Build Success/Failure

One little thing that surprised me is that Visual Studio is not updating the status bar to indicate that a successful build has completed. In the case of a standard Visual Studio project, the status bar displays a message like the following indicating build success.

VSProjectShowBuildResult

In the case of my VS solution containing the iPhone project, the status bar does not update with a success message as you can see here.

XamarinStatusNoBuildResult

I’ve had to have the Output window open so that I can see when a successful build completes.

Although I haven’t tried to exhaustively diagnose the cause, the lack of a success message appears to be tied to the fact that the solution contains an iPhone project (Xamarin will often display the Mac build host IP Address in the status bar). When I create a solution containing only an Android project, the build result displays in the status bar as expected.

Xamarin.Android Beta Issue

Just to follow up on the issue I mentioned in my last post about the Xamarin.Android Beta breaking Xamarin.iOS in Visual Studio.

The folks at Xamarin have followed up and let me know that there is an incompatibility between the Xamarin.Android version that is currently in Beta and the production release of Xamarin.iOS. To safely install the Xamarin.Android Beta, I’ll need to install the corresponding Xamarin.iOS Beta … A very reasonable requirement.

You can find the bug report and Xamarin’s response here.

I’m not sure if I’m going to do the Beta installs right now or not. I may just wait for them to reach production release. I’ll keep y’all updated if I do decide to install the Betas.

Carrying On

So everything appears to now be working. I can start really digging into things now.

I do want to give Kudos to the folks at Xamarin…

So far every issue I’ve raised whether in their Forums or on their Bugzilla page has been responded to in a very reasonable time frame. Thanks guys!