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

Share with
Tags
Latest Comments
By Mark Gentry on Windows Server 2019 - Change product key does nothing
20 Aug 2021, 03:30 AM
By Cathy on In-Place Upgrade for a Windows Server domain controller
31 Jul 2021, 18:28 PM
By Mr. Greymatter on Raspberry Pi - Running Java app on Raspbian
16 Feb 2021, 07:35 AM
By Mikko Seittenranta on Xamarin Forms multiple instances of same app open
16 Feb 2021, 04:34 AM
By Andrew on Auto/Custom height on Xamarin Forms WebView for Android and iOS
22 Jan 2021, 22:15 PM
By Nick on Raspberry Pi - Running Java app on Raspbian
14 Oct 2020, 19:37 PM
By Ivan on Fixed: Value cannot be null Parameter Name: source
15 Sep 2020, 19:47 PM
By Anand on Raspberry Pi - Bluetooth using Bluecove on Raspbian
7 Sep 2020, 16:53 PM
Categories
App Development
Event
Game Development
Mapping
Modelling
Programming
Review
Robotics
Tutorial
Web Development