我在crashlytics中收到一个奇怪的InflateException。仅在具有Android 5.1版的Oppo设备中会发生这种情况。从堆栈跟踪中,可以清楚地看到问题出在TextView上。 堆栈跟踪为
Fatal Exception: android.view.InflateException: Binary XML file line #42: Error inflating class TextView
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.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 android.widget.OppoCursorController$FloatPanelViewController.<init>(OppoCursorController.java:1585)
at android.widget.OppoCursorController.createFloatPanelViewController(OppoCursorController.java:134)
at android.widget.OppoCursorController$SelectionModifierCursorController.<init>(OppoCursorController.java:518)
at android.widget.OppoCursorController.create(OppoCursorController.java:81)
at android.widget.OppoEditor.getOppoSelectionController(OppoEditor.java:417)
at android.widget.OppoEditor.onTouchEventWrap(OppoEditor.java:322)
at android.widget.TextView.onTouchEvent(TextView.java:8189)
at android.view.View.dispatchTouchEvent(View.java:8472)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2417)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2050)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:2440)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1748)
at android.app.Activity.dispatchTouchEvent(Activity.java:2840)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at android.support.v7.view.WindowCallbackWrapper.dispatchTouchEvent(WindowCallbackWrapper.java:69)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:2379)
at android.view.View.dispatchPointerEvent(View.java:8667)
at android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(ViewRootImpl.java:4446)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4234)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3767)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3830)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3786)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:3913)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3794)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:3970)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3767)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:3830)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:3786)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:3794)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:3767)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:6165)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:6139)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:6110)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:6255)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:218)
at android.os.MessageQueue.nativePollOnce(MessageQueue.java)
at android.os.MessageQueue.next(MessageQueue.java:150)
at android.os.Looper.loop(Looper.java:139)
at android.app.ActivityThread.main(ActivityThread.java:5541)
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:964)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:759)
在调试时,我认为引起TextView的问题是
<TextView
android:id="@android:id/title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:singleLine="true"
android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp"
tools:text="Title" />
我在这段代码中找不到任何错误。 我该如何解决??
答案 0 :(得分:0)
我认为这行有误
android:textColor =“?android:attr / textColorPrimary”
输入@而不是? 或尝试提供#000颜色的哈希码。
并告诉我在xml文件第42行中写的内容。