chris Jenx 为 Android Q 编写的书法库崩溃 [英] Crash on calligraphy library by chris Jenx for Android Q

查看:21
本文介绍了chris Jenx 为 Android Q 编写的书法库崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于自定义字体的书法库,它似乎适用于除 android Q 之外的所有版本,它在启动时立即崩溃了我的应用程序.最近有没有其他人不得不处理同样的问题?这是我的崩溃报告:

I have a calligraphy library I am using for custom fonts which seems to work on all versions except for android Q , where it crashes my app right on launch.Any one else has had to deal with the same issue lately? Here's my 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)

请注意,我没有在我的代码中使用 FitWindowsLinearLayout 或 abc_screen_simple,它们都来自这个库.我什至更新到最新版本 2.3.0 :

Please note, I do not use FitWindowsLinearLayout or abc_screen_simple in my code, it all comes from this lib. I have even updated to the latest version 2.3.0 :

实现uk.co.chrisjenx:calligraphy:2.3.0"

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

但没有运气.我什至遵循了这个线程上的答案:Android Q API 29 崩溃但没有运气有什么想法可以解决这个问题吗?

but had no luck. I have even followed the answers on this thread : Crash on Android Q API 29 but no luck Any ideas how to go about this?

谢谢!

推荐答案

你有没有检查图书馆提到

Have you check the library mention that

此版本的 Calligraphy 已过期,不再维护.请迁移到 Calligraphy 3!

dependencies {
    implementation 'io.github.inflationx:calligraphy3:3.1.1'
    implementation 'io.github.inflationx:viewpump:2.0.3'
}

所以我建议您使用最新的,这样您就不会遇到上述问题.因为我也在使用相同的 API 29 没有崩溃.

So I will suggest you use the latest one and you are not going to face the above issue. Because I am also using the same and there is no crash on API 29.

这篇关于chris Jenx 为 Android Q 编写的书法库崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆