visual-studio , xamarin-forms ,

Xamarin development - problems and solutions

Abhith Rajan Abhith Rajan FollowSeptember 02, 2017 · 4 min read · Last Updated:

Following are the list of problems I am addressing here.

The strikethrough indicates that I have found solutions for them. Solutions that worked for me explained below,

Solution for #1: No resource found that matches the given name "Theme.AppCompat.Light" and similar 100+ errors during build.

To solve this, I deleted the Xamarin directory in this path C:\Users\username\AppData\Local\ then opened the solution, rebuild and it worked.

Additional Resources

Solution for #2: Couldn't able to sign into my Xamarin account from visual studio 2017 preview.

I was trying login in VS 2017 Preview 15.4.0 and it wasn't working. After adding the Xamarin related feature pack to my 15.3.3 stable VS 2017, I tried the login in it and it worked. Then checked the login status in VS preview and that was also in the same state as in the stable.

Update 1:

I reported the problem #2 to VisualStudio developer community and here is the link

Solution for #3: Packaging error - “jarsigner.exe” exited with code 1

Updated Xamarin.Forms from 2.3.4.247 to 2.3.4.270. Restarted visual studio. Changed configuration to Release. Tried to deploy and it worked. Switched back to Debug configuration and rerun. And it too worked.

Solution for #4: Project not selected to build for this solution configuration

Found the solution, check your configuration manager and make sure that the "Deploy" box is checked for your target platform. The configuration manager can be found by selecting it from the drop-down arrow next to "Debug".

Additional Resources

Solution for #5: GoogleServicesJson BuildAction missing

This is the second time I came across this problem. When adding Firebase crash reporting component to our Xamarin forms app, we need to add the google-services.json file to the project as well needs to set its build action to "GoogleServicesJson". But after adding the file, when checked the available build actions for the file, there is no "GoogleServicesJson". In that case, unload the project and then edit the ".csproj" file and add the following.

<ItemGroup>
    <GoogleServicesJson Include="google-services.json" />
  </ItemGroup>

Then reload the project. That's it. Check the build action for the file and you can see that it is set to GoogleServicesJson.

Solution for #6: App runs in debug mode, crashes in release mode

When this issue occurred to me, I thought it is because of any configuration mistakes in my Release configuration but the issue solved by a simple process which is Clean the solution and rebuild.

Additional Resources

Solution for #7: Input string was not in a correct format - XAML

This was purely my mistake but it took time to figure it out, especially when your XAML contains more elements. The issue was, the parameter I passed to one of the element's attribute was wrong, i.e more specifically, I passed some hashcode value of some color to one element HeightRequest attribute which should be an integer. There is no warning or anything in VisualStudio to indicate the syntax error and the error during the build is just "Input string was not in a correct format" pointing to the file.

Additional Resources
Abhith Rajan
Written by Abhith Rajan Follow
Abhith Rajan is an aspiring software engineer with more than 6 years of experience and proven successful track record of delivering technology-based products and services.