Our Blog

xamarinios
Ok, once again – I open a Xamarin Forms app, ensure I have the latest Xamarin Forms version in each of the PCL, Android and IOS projects.  The project rebuild works for the PCL and Android projects and fails for the IOS.  The error…

No valid iOS code signing keys found in keychain. You need to request a codesigning certificate from https://developer.apple.com

What’s going on…I first look to ensure my Mac agent is connected yep, perform a clean and rebuild of each project..same error.  The solution for me….

Open the dialog “Xamarin Mac Agent” – right click on the connect Mac – choose ‘Disconnect’.  After disconnection – select the Mac and ‘Connect’…waiting (aha …it won’t connect, this could be the problem)  Nope – didn’t think it would be this easy.  I was able to use the ‘show simulator’ option within vs.net and the simulator popped open on the Mac.  I opened another project to see if this issue was related to the specific project.  Nope.  The 2nd project I opened had the same issue, where in the ‘Device’ list the was no option for ‘iphone simulator’. 

I then proceed to open Xamarin Studio on the Mac (currently I am using the Beta channel as this was necessary to work with Visual Studio 2017).  There is an update and it started to download.  Here is to more hope that this solves the issue.

image

This update on the Mac will move it up to Xamarin Studio 6.2.0  I tried to find the IOS Simulator after this update. Still nothing.  I removed all mac agents, restarted vs.net 2017 a couple times, still nothing.  I opened up another project and magically this time the ‘iphone simulator’ option was available.  Why…no idea..(this product is going to kill me)

image

So now I am thinking there is a difference between the 2 projects.  Why would I have the simulator option in one but not the other?  This is really messed up.  So I open the project that does not have the ‘iphonesimulator’ option, I can see within Configuration Manager that this option exists and I can connect, build, deploy to Mac simulator.  Well this scenario is new to me…no idea.

image

Another day, another issue while building a Xamarin project. In this case, I was building a project from Xamarin and working through some logic.  When building the Android project I was presented with the following build errors.

I am getting use to different errors at the most unexpected times.  This issue was not unlike others that I have come up against with my cross-device mobile development efforts.  The good news, after much hunting and packing I found the solution.  See below.

image

Severity    Code    Description    Project    File    Line    Suppression State
Error    CS0012    The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.    GreatQuotes.Android    C:\Xamarin\10a_xam300\Lab Materials\Part 01 Resources\Start\GreatQuotes.Android\App.cs    9    Active
Error    CS0234    The type or namespace name 'TargetFrameworkAttributeAttribute' does not exist in the namespace 'System.Runtime.Versioning' (are you missing an assembly reference?)    GreatQuotes.Android    C:\Users\dyardy\AppData\Local\Temp\MonoAndroid,Version=v7.1.AssemblyAttributes.cs    4    Active
Error    CS0234    The type or namespace name 'TargetFrameworkAttribute' does not exist in the namespace 'System.Runtime.Versioning' (are you missing an assembly reference?)    GreatQuotes.Android    C:\Users\dyardy\AppData\Local\Temp\MonoAndroid,Version=v7.1.AssemblyAttributes.cs    4    Active
Error    CS0518    Predefined type 'System.String' is not defined or imported    GreatQuotes.Android    C:\Users\dyardy\AppData\Local\Temp\MonoAndroid,Version=v7.1.AssemblyAttributes.cs    4    Active
Error    CS0246    The type or namespace name 'FrameworkDisplayName' could not be found (are you missing a using directive or an assembly reference?)    GreatQuotes.Android    C:\Users\dyardy\AppData\Local\Temp\MonoAndroid,Version=v7.1.AssemblyAttributes.cs    4    Active
Error    CS0518    Predefined type 'System.String' is not defined or imported    GreatQuotes.Android    C:\Users\dyardy\AppData\Local\Temp\MonoAndroid,Version=v7.1.AssemblyAttributes.cs    4    Active
Error    CS0518    Predefined type 'System.Object' is not defined or imported    GreatQuotes.Android    C:\Xamarin\10a_xam300\Lab Materials\Part 01 Resources\Start\GreatQuotes.Android\App.cs    9    Active
Error    CS0518    Predefined type 'System.Void' is not defined or imported    GreatQuotes.Android    C:\Xamarin\10a_xam300\Lab Materials\Part 01 Resources\Start\GreatQuotes.Android\App.cs    9    Active
Error    CS0012    The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.    GreatQuotes.Android    C:\Xamarin\10a_xam300\Lab Materials\Part 01 Resources\Start\GreatQuotes.Android\App.cs    9    Active
Error    CS0246    The type or namespace name 'Icon' could not be found (are you missing a using directive or an assembly reference?)    GreatQuotes.Android    C:\Xamarin\10a_xam300\Lab Materials\Part 01 Resources\Start\GreatQuotes.Android\App.cs    9    Active
Error    CS0518    Predefined type 'System.Object' is not defined or imported    GreatQuotes.Android    C:\Xamarin\10a_xam300\Lab Materials\Part 01 Resources\Start\GreatQuotes.Android\App.cs    9    Active
Error    CS0518    Predefined type 'System.String' is not defined or imported    GreatQuotes.Android    C:\Xamarin\10a_xam300\Lab Materials\Part 01 Resources\Start\GreatQuotes.Android\App.cs    9    Active
Error    CS0012    The type 'Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.    GreatQuotes.Android    C:\Xamarin\10a_xam300\Lab Materials\Part 01 Resources\Start\GreatQuotes.Android\App.cs    9    Active

 

The solution (to make a very long story short) was to unload the project from Visual Studio.  Open the csproj and add the following reference (in bold).  I initially was comparing some of my working Android projects with this one that just would not build. I noticed the reference to mscorlib.  I tried to add a reference to this dll directly through ‘Add Reference’ but I got the following error "mscorlib.dll" component is already automatically referenced.  The build system should add this reference for you.

 

Since I could not add through the VS.NET interface, i chose to add via csproj file.  After reloading the project and rebuilding the reference to mscorlib was visible in the list of references and finally my project built fine.

<ItemGroup>
  <Reference Include="Mono.Android" />
  <Reference Include="mscorlib" />
  <Reference Include="System" />
  <Reference Include="System.Xml" />
  <Reference Include="System.Core" />
  <Reference Include="System.Xml.Linq" />
</ItemGroup>

About Us

Web/Mobile Solutions

Our Contacts

Cincinnati, OH 45069