0

After migration to AndroidX my app crashes after calling Snackbar.make() method. The error looks like

Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class android.support.design.internal.SnackbarContentLayout Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.internal.SnackbarContentLayout"

It's strange that internal Snackbar method make() is still trying to access SnackbarContentLayout class in old support package instead new material's one. Please advice what I'm doing wrong.

UPDATE

Finally I found a solution. There is a custom layout in my project which overrides Snackbar's design_layout_snackbar_include and it had wrong class in root view tag:

<view
  xmlns:android="http://schemas.android.com/apk/res/android"
  class="android.support.design.internal.SnackbarContentLayout"
  android:theme="@style/ThemeOverlay.AppCompat.Dark"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:layout_gravity="bottom">

I changed it to com.google.android.material.snackbar.SnackbarContentLayout

1 Answers1

0

ensure that your project is set up to migrate old packages to Androidx by including this in your gradle.properties file:

android.useAndroidX=true
android.enableJetifier=true

Pasca
  • 36
  • 5