0
Caused by: android.view.InflateException: Binary XML file line #17 in com.acadamis.vidyaspoorthiteacher:layout/abc_screen_toolbar: Binary XML file line #17 in com.acadamis.vidyaspoorthiteacher:layout/abc_screen_toolbar: Error inflating class androidx.appcompat.widget.ActionBarOverlayLayout

Caused by: android.view.InflateException: Binary XML file line #17 in com.acadamis.vidyaspoorthiteacher:layout/abc_screen_toolbar: Error inflating class androidx.appcompat.widget.ActionBarOverlayLayout

AndroidRuntime:     at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)

** It's working up to API 28, but not for API 29

Priyanka
  • 3,369
  • 1
  • 10
  • 33
Ashwin H
  • 695
  • 7
  • 24
  • what is at line 17 in `layout/abc_screen_toolbar`? paste whole xml view – Priyanka Mar 03 '20 at 12:20
  • got the solution: https://stackoverflow.com/questions/56524914/crash-on-android-10-inflateexception-in-layout-abc-screen-simple-line-17 – Ashwin H Mar 05 '20 at 12:55
  • Does this answer your question? [Crash on Android 10 (InflateException in layout/abc\_screen\_simple line #17)](https://stackoverflow.com/questions/56524914/crash-on-android-10-inflateexception-in-layout-abc-screen-simple-line-17) – Priyanka Mar 13 '20 at 11:45

1 Answers1

3

This problem happens when using calligraphy library.

implementation 'uk.co.chrisjenx:calligraphy:2.3.0'

Solution:

Replace new calligraphy library

implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.3'

Change the calligraphy initial code

ViewPump.init(ViewPump.builder()
            .addInterceptor(new CalligraphyInterceptor(
                    new CalligraphyConfig.Builder()
                            .setDefaultFontPath("1.ttf")
                            .setFontAttrId(R.attr.fontPath)
                            .build()))
            .build());

And change wrapper

super.attachBaseContext(ViewPumpContextWrapper.wrap(newBase));