Deathgar Vyathemskiy
Deathgar Vyathemskiy

Reputation: 21

'Unable to convert instance of type 'Google.Android.Material.TextView.MaterialTextView' to type 'AndroidX.AppCompat.Widget.Toolbar'.'

After upgrading the Xamarin Forms version from 4.5.+ To 5.0, the following exception appeared. Any suggestions how to solve it ??

Exception Image
Exception Image

Upvotes: 1

Views: 489

Answers (2)

cahyo
cahyo

Reputation: 607

Check your Toolbar.axml and Tabbar.axml then update your class to AndroidX class name mapping here

Upvotes: 1

Romman
Romman

Reputation: 360

Well the error is well explained

'Unable to convert instance of type 'Google.Android.Material.TextView.MaterialTextView' to type 'AndroidX.AppCompat.Widget.Toolbar'.'

You are trying cast an object with a different object. Simply, think like this

you are trying to cast a car into a carpet

So, it's not possible. That's why the error occured.

Upvotes: 0

Related Questions