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 Cary on MVC forms in Umbraco
12 Aug 2018, 02:58 AM
By Naufil on How to open a modal window for a custom datatype in the Umbraco back office
30 Jul 2018, 12:40 PM
By Trevor on Replacing the Xamarin Header/Navigation bar with a custom view/template
19 Jul 2018, 18:36 PM
By Luke on Setting up tables in SQLite with a primary key on a Xamarin Forms app
11 Jul 2018, 09:18 AM
By Travis on Setting up tables in SQLite with a primary key on a Xamarin Forms app
7 Jul 2018, 15:44 PM
By Luke on Auto/Custom height on Xamarin Forms WebView for Android and iOS
15 Jun 2018, 09:43 AM
By vikki on Auto/Custom height on Xamarin Forms WebView for Android and iOS
14 Jun 2018, 13:35 PM
By jimbo on JQuery Unobtrusive Validation for dynamically created elements
13 Jun 2018, 17:13 PM
Categories
App Development
Event
Game Development
Mapping
Modelling
Programming
Review
Robotics
Tutorial
Web Development