mikepenz/Android-Iconics

Upgrade with SDK 29

mobile-simformsolutions opened this issue · 4 comments

I am using the below dependency for my app which is in java language with target SDK 28. And it's working fine with SDK 28.

implementation "com.mikepenz:iconics-core:3.0.0@aar"
implementation 'com.mikepenz:material-design-iconic-typeface:2.2.0.4@aar'

Now I want to upgrade the app with SDK 29. When I upgrade it then it's given me the below error.

Caused by: android.view.InflateException: Binary XML file line #23 in com.abc.android.debug:layout/abc_screen_simple_overlay_action_mode: Binary XML file line #23 in com.abc.android.debug:layout/abc_screen_simple_overlay_action_mode: Error inflating class androidx.appcompat.widget.FitWindowsFrameLayout
     Caused by: android.view.InflateException: Binary XML file line #23 in com.abc.android.debug:layout/abc_screen_simple_overlay_action_mode: Error inflating class androidx.appcompat.widget.FitWindowsFrameLayout
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object java.lang.reflect.Field.get(java.lang.Object)' on a null object reference

As I found suggestions in the below link, like the need to upgrade the Iconics library. But getting the same error.
https://stackoverflow.com/questions/57627223/error-inflating-class-androidx-appcompat-widget-fitwindowsframelayout-after-migr

I upgrade the library with below

implementation "com.mikepenz:iconics-core:3.2.5"
 implementation 'com.mikepenz:material-design-iconic-typeface:2.2.0.5'

Thank you in Advance.

@mobile-simformsolutions please update to the latest release.

We removed the support for a context wrapper due to these problems over time.

@mikepenz : Thanks for your quick response.

What is the solution for removed support for context wrapper?

Getting error in below line

@Override
    protected void attachBaseContext(Context newBase) {
        super.attachBaseContext(IconicsContextWrapper.wrap(newBase));
    }

Due to the highly unpredicatable and unstable API from Android in this regards, the advised solution is to either use the IconicsDrawable as Drawable itself (this is the favoured solution for most implementations)

Alternative use one of the provided Iconics views.


As a result of the unpredictable behaviour the context wrapper and inflator alternative have both been deprecated and removed from the library. and are no longer found in recent releases.