System.TypeLoadException: Could not resolve type with token 0100017e

What caused 'System.TypeLoadException: Could not resolve type with token 0100017e'?

This issue presented itself when I first started trying to get Firebase Cloud Messaging installed on a new Xamarin app for the purpose of adding a remote notifications capability.

Whilst following the tutorial laid out for me on this page: https://developer.xamarin.com/guides/android/application_fundamentals/notifications/remote-notifications-with-fcm/

You have to love that they have 'Beta' slapped accross the page, this almost instantly throws up a red flag for any developer followed by a very large sigh.

Xamarin Beta

The issue was that since the Xamarin tutorial requires you to install Xamarin.Firebase.Messaging, Xamarin and it would conflict with the versions of Xamarin.Android.Support.v4 that they required. The exact case was that Xamarin Forms has a requirement for 'Xamarin.Android.Support.v4 (= 23.3.0)' and Xamarin.Firebase.Messaging had a requirement for 'Xamarin.GooglePlayServices.Basement (= 32.961.0)' which in turn had a requirement for 'Xamarin.Android.Support.v4 (>= 24.2.1)'.

Now we all know that you can't have 'Xamarin.Android.Support.v4 (= 23.3.0)' and 'Xamarin.Android.Support.v4 (>= 24.2.1)' installed on the same project, so what do we do?

The thing is, I went down the route of forcing an update and ignoring the dependency versions which provided me with the error 'System.TypeLoadException: Could not resolve type with token 0100017e' so it was starting to become fairly obvious that you can't just force the version to install and that they have dependencies for a reason.

So we're still left with the knowledge that you need to install the correct version of the package so that it matches the dependency requirements of all the other installed packages.

The Answer:

The simple answer is that instead of installing the package versions specified in the tutorial, you need to install this specific version of Xamarin.Firebase.Messaging... 32.940.0-beta3

Make sure that when you install the package, you check that under Options for that packages, Dependency Behaviour is set to Lowest, and the other required packages will install with it at a similar version and will be compatible with your other installed packages.

More information:

If you're interested in learning how to set up Firebase Cloud Messaging for both iOS and Android in Xamarin, I'll be adding a new blog post by the end of this month on how to do exactly that.


Published at

Tags: Xamarin,Android

Luke Alderton

Comments

Post a comment
Sit tight...
We're adding your comment.
Thank you.
Your comment has been added.
There's been a problem.
Please try again later.
Share with
Tags
Latest Comments
By PS on Replacing the Xamarin Header/Navigation bar with a custom view/template
16 Apr 2018, 07:53 AM
By Srusti Thakkar on How to add a Xamarin Forms Loading Screen/Overlay
27 Mar 2018, 18:22 PM
By Luke on How to add a Xamarin Forms Loading Screen/Overlay
23 Mar 2018, 15:03 PM
By Srusti Thakkar on How to add a Xamarin Forms Loading Screen/Overlay
23 Mar 2018, 13:16 PM
By Marco Teodoro on Custom section tree nodes and routes - Umbraco
21 Mar 2018, 11:08 AM
By ttt asd on Limit Google Autocomplete results to country and city
20 Mar 2018, 11:53 AM
By hamid on Limit Google Autocomplete results to country and city
19 Mar 2018, 21:13 PM
By matt on Auto/Custom height on Xamarin Forms WebView for Android and iOS
17 Mar 2018, 02:18 AM
Categories
App Development
Event
Game Development
Mapping
Modelling
Programming
Review
Robotics
Tutorial
Web Development