gpt4 book ai didi

android - v7 支持 23.0.1 崩溃 : AppCompatButton. setBackgroundDrawable

转载 作者:太空狗 更新时间:2023-10-29 15:35:57 29 4
gpt4 key购买 nike

我遇到了这次崩溃,支持库 23.0.1

显示对话框 fragment 时会发生这种情况。

它使用 android.support.v4.app.DialogFragmentandroid.support.v7.app.AppCompatDialogFragment 进行验证

还有其他人遇到过这种情况吗?

它总是发生在发布编译(启用了 Proguard)中,并且仅在某些情况下发生在调试编译中。

我正在报告两个 fragment 类的崩溃堆栈。

android.support.v4.app.DialogFragment 的堆栈:

android.view.InflateException: Binary XML file line #115: Error inflating class Button
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)
at com.android.internal.app.AlertController.installContent(AlertController.java:235)
at android.app.AlertDialog.onCreate(AlertDialog.java:356)
at android.app.Dialog.dispatchOnCreate(Dialog.java:373)
at android.app.Dialog.show(Dialog.java:274)
at android.support.v4.app.DialogFragment.onStart(SourceFile:406)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1060)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1207)
at android.support.v4.app.BackStackRecord.run(SourceFile:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(SourceFile:1572)
at android.support.v4.app.FragmentManagerImpl$1.run(SourceFile:493)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.o.a()' on a null object reference
at android.support.v7.widget.AppCompatButton.setBackgroundDrawable(SourceFile:85)
at android.view.View.setBackground(View.java:16226)
at android.view.View.(View.java:4103)
at android.widget.TextView.(TextView.java:637)
at android.widget.Button.(Button.java:111)
at android.widget.Button.(Button.java:107)
at android.support.v7.widget.AppCompatButton.(SourceFile:64)
at android.support.v7.widget.AppCompatButton.(SourceFile:60)
at android.support.v7.internal.app.AppCompatViewInflater.createView(SourceFile:101)
at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(SourceFile:966)
at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(SourceFile:44)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:725)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:378)
at com.android.internal.app.AlertController.installContent(AlertController.java:235)
at android.app.AlertDialog.onCreate(AlertDialog.java:356)
at android.app.Dialog.dispatchOnCreate(Dialog.java:373)
at android.app.Dialog.show(Dialog.java:274)
at android.support.v4.app.DialogFragment.onStart(SourceFile:406)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1060)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1207)
at android.support.v4.app.BackStackRecord.run(SourceFile:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(SourceFile:1572)
at android.support.v4.app.FragmentManagerImpl$1.run(SourceFile:493)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

android.support.v7.app.AppCompatDialogFragment 的堆栈:

android.view.InflateException: Binary XML file line #29: Error inflating class Button
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at eu.baroncelli.oraritrenitalia.mainactivity.AlertDialogFragment.onCreateView(SourceFile:62)
at android.support.v4.app.Fragment.performCreateView(SourceFile:1962)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1026)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1207)
at android.support.v4.app.BackStackRecord.run(SourceFile:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(SourceFile:1572)
at android.support.v4.app.FragmentManagerImpl$1.run(SourceFile:493)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.o.a()' on a null object reference
at android.support.v7.widget.AppCompatButton.setBackgroundDrawable(SourceFile:85)
at android.view.View.setBackground(View.java:16226)
at android.view.View.(View.java:4103)
at android.widget.TextView.(TextView.java:637)
at android.widget.Button.(Button.java:111)
at android.widget.Button.(Button.java:107)
at android.support.v7.widget.AppCompatButton.(SourceFile:64)
at android.support.v7.widget.AppCompatButton.(SourceFile:60)
at android.support.v7.internal.app.AppCompatViewInflater.createView(SourceFile:101)
at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(SourceFile:966)
at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(SourceFile:44)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:725)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:809)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at eu.baroncelli.oraritrenitalia.mainactivity.AlertDialogFragment.onCreateView(SourceFile:62)
at android.support.v4.app.Fragment.performCreateView(SourceFile:1962)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1026)
at android.support.v4.app.FragmentManagerImpl.moveToState(SourceFile:1207)
at android.support.v4.app.BackStackRecord.run(SourceFile:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(SourceFile:1572)
at android.support.v4.app.FragmentManagerImpl$1.run(SourceFile:493)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)

最佳答案

根据 this如果您使用的是 appcompat-v7,您的混淆器设置应包含以下规则:

-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }

-keep public class * extends android.support.v4.view.ActionProvider {
public <init>(android.content.Context);
}

这也将使您在使用 SearchView 和我想象的其他东西时免于麻烦。

关于android - v7 支持 23.0.1 崩溃 : AppCompatButton. setBackgroundDrawable,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32813894/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com