InflationX / Calligraphy

Custom fonts in Android the easy way...
Apache License 2.0
1.09k stars 81 forks source link

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.google.firebase.iid.FirebaseInstanceIdReceiver #42

Closed Gkundu1 closed 3 years ago

Gkundu1 commented 5 years ago

Fatal Exception: java.lang.RuntimeException: Unable to start receiver com.google.firebase.iid.FirebaseInstanceIdReceiver: java.lang.ClassCastException: io.github.inflationx.viewpump.ViewPumpContextWrapper cannot be cast to android.app.ContextImpl

The above message appears and closes the application when the application running in the device for the first time. Keep appearing once updated the code with the line under my custom application class

override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(ViewPumpContextWrapper.wrap(base!!))
    }

As per the documentation its mandatory to implement the above mention code to load or inject the custom font.

erleizh commented 5 years ago

https://github.com/chrisjenx/Calligraphy/issues/357

devabir93 commented 4 years ago

any help please ?

chrisjenx commented 3 years ago

Did you attachBaseContext to the Application class instead of Activity by chance? you override the Activity not the Application class, double check that, and if there is still an issue please reopen.