InflationX / Calligraphy

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

Crash #39

Closed goodluckier closed 3 years ago

goodluckier commented 4 years ago

I download your demo,targetSdkVersion 28:can run.When i change to 29,not working.My app is adapter Android 10.

goodluckier commented 4 years ago

2019-08-29 11:34:54.375 27798-27798/io.github.inflationx.calligraphy3.sample E/AndroidRuntime: FATAL EXCEPTION: main Process: io.github.inflationx.calligraphy3.sample, PID: 27798 java.lang.RuntimeException: Unable to start activity ComponentInfo{io.github.inflationx.calligraphy3.sample/io.github.inflationx.calligraphy3.sample.MainActivity}: android.view.InflateException: Binary XML file line #17 in io.github.inflationx.calligraphy3.sample:layout/abc_screen_simple: Binary XML file line #17 in io.github.inflationx.calligraphy3.sample:layout/abc_screen_simple: Error inflating class androidx.appcompat.widget.FitWindowsLinearLayout at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3122) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3258) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:81) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1936) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7144) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:925) Caused by: android.view.InflateException: Binary XML file line #17 in io.github.inflationx.calligraphy3.sample:layout/abc_screen_simple: Binary XML file line #17 in io.github.inflationx.calligraphy3.sample:layout/abc_screen_simple: Error inflating class androidx.appcompat.widget.FitWindowsLinearLayout Caused by: android.view.InflateException: Binary XML file line #17 in io.github.inflationx.calligraphy3.sample:layout/abc_screen_simple: Error inflating class androidx.appcompat.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 io.github.inflationx.viewpump.ReflectionUtils.getValue(Unknown Source:0) at io.github.inflationx.viewpump.ViewPumpLayoutInflater.createCustomViewInternal(Unknown Source:38) at io.github.inflationx.viewpump.ViewPumpLayoutInflater.access$000(Unknown Source:0) at io.github.inflationx.viewpump.ViewPumpLayoutInflater$PrivateWrapperFactory2ViewCreator.onCreateView(Unknown Source:12) at io.github.inflationx.viewpump.FallbackViewCreationInterceptor.intercept(Unknown Source:24) at io.github.inflationx.viewpump.InterceptorChain.proceed(Unknown Source:31) at io.github.inflationx.calligraphy3.CalligraphyInterceptor.intercept(Unknown Source:4) at io.github.inflationx.viewpump.InterceptorChain.proceed(Unknown Source:31) at io.github.inflationx.viewpump.ViewPump.inflate(Unknown Source:8) at io.github.inflationx.viewpump.ViewPumpLayoutInflater$PrivateWrapperFactory2.onCreateView(Unknown Source:34) at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:239) at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1084) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1012) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:976) at android.view.LayoutInflater.inflate(LayoutInflater.java:674) at io.github.inflationx.viewpump.ViewPumpLayoutInflater.inflate(Unknown Source:3) at android.view.LayoutInflater.inflate(LayoutInflater.java:549) at android.view.LayoutInflater.inflate(LayoutInflater.java:496) at androidx.appcompat.app.f.v(Unknown Source:219) at androidx.appcompat.app.f.u(Unknown Source:4) at androidx.appcompat.app.f.b(Unknown Source:0) at androidx.appcompat.app.c.setContentView(Unknown Source:4) at io.github.inflationx.calligraphy3.sample.MainActivity.onCreate(Unknown Source:6) at android.app.Activity.performCreate(Activity.java:7698) at android.app.Activity.performCreate(Activity.java:7687) 2019-08-29 11:34:54.376 27798-27798/io.github.inflationx.calligraphy3.sample E/AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1300) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3097) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3258) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:81) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1936) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7144) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:925)

goodluckier commented 4 years ago

add this : implementation 'me.weishu:free_reflection:2.1.0',working

chrisjenx commented 3 years ago

We fixed this is ViewPump 2.0.3 a while back, make sure you are targeting that version.