Ashwin H
Ashwin H

Reputation: 723

Unable to start activity ComponentInfo android.view.InflateException: Binary XML file line #17 in layout/abc_screen_toolbar:

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

Upvotes: 0

Views: 2328

Answers (1)

amir tavizi
amir tavizi

Reputation: 31

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));

Upvotes: 3

Related Questions