chris Jenx 为 Android Q 设计的书法库崩溃
Crash on calligraphy library by chris Jenx for Android Q
我有一个用于自定义字体的书法库,它似乎适用于除 android Q 之外的所有版本,它使我的应用程序在 launch.Any 上崩溃,其他人不得不处理最近有同样的问题?这是我的崩溃报告:
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[=11=]0(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 :
实施"uk.co.chrisjenx:calligraphy:2.3.0"
但运气不佳。我什至关注了这个线程的答案:
但没有运气
有什么想法可以解决这个问题吗?
谢谢!
你查过图书馆提到过
此版本的 Calligraphy 已停产,不再维护。请迁移到 Calligraphy 3!
dependencies {
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.3'
}
所以我会建议你使用最新的,你不会面临上述问题。因为我也在使用相同的并且 API 29.
上没有崩溃
我有一个用于自定义字体的书法库,它似乎适用于除 android Q 之外的所有版本,它使我的应用程序在 launch.Any 上崩溃,其他人不得不处理最近有同样的问题?这是我的崩溃报告:
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[=11=]0(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 :
实施"uk.co.chrisjenx:calligraphy:2.3.0"
但运气不佳。我什至关注了这个线程的答案:
谢谢!
你查过图书馆提到过
此版本的 Calligraphy 已停产,不再维护。请迁移到 Calligraphy 3!
dependencies {
implementation 'io.github.inflationx:calligraphy3:3.1.1'
implementation 'io.github.inflationx:viewpump:2.0.3'
}
所以我会建议你使用最新的,你不会面临上述问题。因为我也在使用相同的并且 API 29.
上没有崩溃