-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android application crashes for calligraphy library for Android Q #475
Comments
Fixed in ViewPump, we worked around the issue, you'll need to upgrade to that. |
You mean use this : implementation 'io.github.inflationx:calligraphy3:3.1.1',replace :compile 'uk.co.chrisjenx:calligraphy:2.3.0' ? |
is it backwards compatible though? the new viewpump crashes for previous OS version (P and below. |
@chrisjenx exactly what changes are required to provide support for an old project where this old calligraphy library used, instead of changing to View pump, because that will be a major change for us. |
ViewPump is a very small migration, also as deps are transitive, you only need to follow the setup for Calligraphy 3 Setup. There are many changes to make this injector valid, you would literally need to backport ViewPump back to this - it's much less work to move to VP. |
migrate to Calligraphy 3 |
What about the crash that older target sdk version apps are facing, if they update to Calligraphy 3 ? Looks like some other Calligraphy library will be needed, because you are not providing a backwards compatible solution. @chrisjenx Please use https://www.xda-developers.com/android-development-bypass-hidden-api-restrictions/ article to by pass reflection api restrictions by google, so that your library can be used for backwards compatibility. |
It's not an api restriction issue, the implementation on Q+ is different (to the point the hack isn't really needed on Q+). |
What about the crash that older target sdk version apps are facing, if they update to Calligraphy 3? |
Thank you so much bro |
No idea, but if it's problem still on ViewPump + Calligraphy 3 then we'll fix it over there. 👍 |
CalligraphyConfig.initDefault(new CalligraphyConfig.Builder() write this line ---- disableCustomViewInflation() |
it helped me, thank you |
you saved my day, thanks. |
Does it support lower versions like Android L,M ? |
Yes |
I try to ViewPump ,but Failed resolution of: Lio/github/inflationx/viewpump/ViewPump; |
Hey @chrisjenx , I am using your calligraphy library for my app and seems like it crashes right on app launch for Android Q. I have seen other people complain about this lately aswell. I have the latest version of your lib 2.3.0 and still face this issue. Any update if you are aware of this or if I need to do anything on my end to sort this out?
Here's the crash report:
Caused by: android.view.InflateException: Binary XML file line #17 in com.myapp.dev:layout/abc_screen_simple: Binary XML file line #17 in com.myapp.dev:layout/abc_screen_simple: Error inflating class android.support.v7.widget.FitWindowsLinearLayout
Caused by: android.view.InflateException: Binary XML file line #17 in commyapp.dev:layout/abc_screen_simple: Error inflating class android.support.v7.widget.FitWindowsLinearLayout
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
at uk.co.chrisjenx.calligraphy.ReflectionUtils.getValue(ReflectionUtils.java:29)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.createCustomViewInternal(CalligraphyLayoutInflater.java:203)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.access$000(CalligraphyLayoutInflater.java:20)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$PrivateWrapperFactory2.onCreateView(CalligraphyLayoutInflater.java:302)
at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:239)
at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1069)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:997)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.inflate(LayoutInflater.java:659)
at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at android.support.v7.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:631)
at android.support.v7.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:518)
at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:466)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
at com.myapp.dev.ui.splash.SplashActivity.onCreate(SplashActivity.java:36)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
The text was updated successfully, but these errors were encountered: