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 Luke Alderton on Replacing the Xamarin Header/Navigation bar with a custom view/template
17 Jan 2018, 15:30 PM
By Luke Alderton on My experience at Umbraco UK Festival 2017
17 Jan 2018, 14:51 PM
By Victor La Fortuna on Solved: 'Debug/ibTool/LaunchScreen.storyboardc/Info.plist does not exist' Xamarin
10 Jan 2018, 14:32 PM
By Jose Luis on Replacing the Xamarin Header/Navigation bar with a custom view/template
7 Jan 2018, 11:06 AM
By Chris Howarth on My experience at Umbraco UK Festival 2017
28 Dec 2017, 10:32 AM
By Luke Alderton on Xamarin forms - Stop/Cancel back button event
20 Dec 2017, 05:49 AM
By Antony on Xamarin forms - Stop/Cancel back button event
18 Dec 2017, 11:19 AM
By dipbleds on Raspberry Pi - Bluetooth using Bluecove on Raspbian
12 Dec 2017, 21:29 PM
Categories
App Development
Event
Game Development
Mapping
Modelling
Programming
Review
Robotics
Tutorial
Web Development