Help me fix this Android.Views.InflateException

eduardk 46 Reputation points
2020-12-04T15:17:44.523+00:00

Hi.

I try to use Fingerprint plugin. In PCL project my MainPage derives from Shell and this is a problem. If the MainPage do not derives from Shell than it's ok and I don't have any error.

I have the following error on Build:

Android.Views.InflateException: 'Binary XML file line #1 in com.companyname.app417:layout/flyoutcontent: Binary XML file line #1 in com.companyname.app417:layout/flyoutcontent: Error inflating class android.support.design.widget.CoordinatorLayout'

I had this kind of error before for ToolBar file in Xamarin.Andoird layout folder. I Fixed it by changing the name from android.support.v7.widget.Toolbar to androidx.appcompat.widget.Toolbar and this solved the issue.
The problem is that I don't have any flyoutcontent file in Xamarin.Android layout folder and cannot rename it.

How can I fix this?

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,362 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JessieZhang-MSFT 7,711 Reputation points Microsoft Vendor
    2020-12-07T02:57:52.747+00:00

    Hello,

    Welcome to our Microsoft Q&A platform!

    I Fixed it by changing the name from android.support.v7.widget.Toolbar to androidx.appcompat.widget.Toolbar and this solved the issue.

    The androidx.appcompat.widget.Toolbar is targeted for higher android version.

    You can try to set the android Target Frame to higher version,for example android 10.0(Q) .

    45438-image.png

    Hope it can help you.

    Best Regards,

    Jessie Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.