Thursday, February 19, 2015

Xamarin.Forms - "InitializeComponent() was not found" error in a XAML page

I recently ran into an issue in Xamarin.Forms where previously working XAML (within a Content Page XAML) just stopped working and the following error was raised in Xamarin Studio:

InitializationComponent() was not found

I did some research and found that the myProject.projItems (*) file in the Xamarin.Forms project was changed and the XAML Content Pages nodes were no longer setup correctly.  Somehow Xamarin Studio changed the file and the XAML page nodes were now:

<Page Include="$(MSBuildThisFileDirectory)Views\Controls\MyContentPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
</Page>

When I changed the nodes to match the following, the InitializeComponent() error went away.:

<EmbeddedResource Include="$(MSBuildThisFileDirectory)Views\Controls\MyContentPage.xaml">
      <SubType>Designer</SubType>
      <Generator>MSBuild:Compile</Generator>
 </EmbeddedResource>

I then went through the file and changed the other XAML files, and restarted Xamarin Studio and the error went away.

(*) NOTE - My Xamarin.Forms project wasn't named "myProject", it is set to that name to simplify the illustration. :) 

Monday, January 19, 2015

Windows Phone 8.1 Lumia 1520 Group Messaging issue

Recently I had an issue with a Lumia 1520, running Windows Phone 8.1, where my text messages sent to a group text were immediately sent back to me, in addition to the group.  My phone number would be added to the group text and I received each and every text that I sent, as well as those from the members of the group text.  It was more than annoying. 

After doing some research, I found out how to stop this from occurring; the steps are below.  I've already had to apply this "fix" at least three times over the past three months, so I know it works, but I'm just not sure why it happens in the first place.

Here are the steps to correct the issue:

  1. On your phone, go into Settings
  2. Swipe right to the "applications" tab, and select "messaging"
  3. Turn off Group Text by unselecting the option
  4. Restart your Lumia 1520 by holding the lock button - camera button - and volume down button at the same time until your phone vibrates and restarts.
  5. Once your phone restarts, go back into Settings and turn Group Text back on.
  6. I then delete any group text threads where my phone number appears as a recipient.

Again, not sure why this happens, but it started happening in October 2014 and has occurred about four times since the time of writing this post.  I am part of the Developer Preview program so it may have something to do with that, but hopefully it is fixed before the next official OS release / update.

I'm running Windows Phone - 8.10.14219.341, with Lumia Cyan.  Anyway, hope this helps someone else.