Please help on this InflateException when inflating AppCompatImageView

Alex Yao 1 Reputation point
2022-12-30T14:03:25.24+00:00

Hi,

I'm working on a Xamarin app with an existing .aar lib. The lib was tested with a native Android demo application, and it works fine with the demo.

But when I invoke it through my Xamarin app, following InflateException was always thrown:

Android.Views.InflateException: 'Binary XML file line #1 in com.radaee.reader:layout/bar_cmd: Binary XML file line #1 in com.radaee.reader:layout/bar_cmd: Error inflating class androidx.appcompat.widget.AppCompatImageView'

Looks like some dependencies are missing from the Xamarin project, but I've added following dependencies from NuGet:

  • Xamarin.AndroidX.AppCompat
  • Xamarin.AndroidX.AppCompat.AppCompatResources
  • Xamarin.Android.Support.v4

Those are basically what the Android native application used. Could anyone please help on how the issue comes and how should I fix it? Any help would be appreciated.

Thank you.

B.R./Alex

Developer technologies .NET Xamarin
{count} votes

1 answer

Sort by: Most helpful
  1. cristopheB 551 Reputation points
    2022-12-30T14:24:02.933+00:00

    Hello,

    i've never try this component but after search on 3w i've find you need to initialize the lib with

    global.init();

    https://stackoverflow.com/questions/43842407/pdfreader-utility-radaee-causing-application-crashed


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.