MaterialCardView InflateException
im using latest vs2019 + xamarin android 10.2 I successfully updated to AndroidX. when i use androidx.cardview.widget.CardView everything works, but when replaced to com.google.android.material.card.MaterialCardView I get an error
Android.Views.InflateException: 'Binary XML file line #1: Binary XML file line #1: Error inflating class com.google.android.material.card.MaterialCardView'
in
View itemView = LayoutInflater.From(parent.Context).
Inflate(Resource.Layout.cv_item_template, parent, false);
@jenokizm THanks for the report.
According to
https://developer.android.com/reference/com/google/android/material/card/MaterialCardView
com.google.android.material.card.MaterialCardView derives from androidx.cardview.widget.CardView.
Did you add Material nuget?
https://www.nuget.org/packages/Xamarin.Google.Android.Material/
Otherwise, please submit link to repo (or zip archive) for minimal repro sample. Thanks
thanks, yes Xamarin.Google.Android.Material 1.1.0-rc3 I can’t provide an example because I have a big project and a slowed down laptop, I don’t have time to put together a minimal example. I will do it from the main computer not earlier than in a month, if you have time try just binding with RecyclerView.Adapter this should result in an error in the line LayoutInflater
Can you at least provide MainActivity and layout file, or write down steps from creating project (short steps like create app, add layout, change code...)
AppMaterialCardViewTest.zip hi, this demo app. to reproduce the error replace androidx.cardview.widget.CardView to com.google.android.material.card.MaterialCardView (in cv_lesson2.xml) and click the fab button.
@jenokizm Thanks for the sample. I will look at it ASAP.
Closing as this is likely stale. If this is still an issue, please create a new issue.