java.lang.AbstractMethodError崩溃android.text.TextUtils.writeToParcel可能与可访问性有关

时间:2017-12-19 15:56:33

标签: java android crash

我在Android应用的Google Play控制台上看到了以下崩溃事件。我无法重现这些问题,也不知道在App中这个崩溃发生在哪里? (适用于运行6.0或更高版本的设备)

崩溃1

java.lang.AbstractMethodError: 
  at android.text.TextUtils.writeToParcel (TextUtils.java:648)
  at android.os.Parcel.writeCharSequence (Parcel.java:585)
  at android.os.Parcel.writeValue (Parcel.java:1420)
  at android.os.Parcel.writeList (Parcel.java:811)
  at android.view.accessibility.AccessibilityEvent.writeAccessibilityRecordToParcel (AccessibilityEvent.java:1174)
  at android.view.accessibility.AccessibilityEvent.writeToParcel (AccessibilityEvent.java:1140)
  at android.view.accessibility.IAccessibilityManager$Stub$Proxy.sendAccessibilityEvent (IAccessibilityManager.java:269)
  at android.view.accessibility.AccessibilityManager.sendAccessibilityEvent (AccessibilityManager.java:319)
  at android.view.ViewRootImpl.requestSendAccessibilityEvent (ViewRootImpl.java:6725)
  at android.view.ViewGroup.requestSendAccessibilityEvent (ViewGroup.java:891)
  at android.view.ViewGroup.requestSendAccessibilityEvent (ViewGroup.java:891)
  at android.view.ViewGroup.requestSendAccessibilityEvent (ViewGroup.java:891)
  at android.view.ViewGroup.requestSendAccessibilityEvent (ViewGroup.java:891)
  at android.view.ViewGroup.requestSendAccessibilityEvent (ViewGroup.java:891)
  at android.view.ViewGroup.requestSendAccessibilityEvent (ViewGroup.java:891)
  at android.view.ViewGroup.requestSendAccessibilityEvent (ViewGroup.java:891)
  at android.view.ViewGroup.requestSendAccessibilityEvent (ViewGroup.java:891)
  at android.view.ViewGroup.requestSendAccessibilityEvent (ViewGroup.java:891)
  at android.view.ViewGroup.requestSendAccessibilityEvent (ViewGroup.java:891)
  at android.view.View.sendAccessibilityEventUncheckedInternal (View.java:6298)
  at android.view.View$AccessibilityDelegate.sendAccessibilityEventUnchecked (View.java:23345)
  at android.support.v4.view.AccessibilityDelegateCompat.sendAccessibilityEventUnchecked (AccessibilityDelegateCompat.java:248)
  at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateApi16Impl$1.sendAccessibilityEventUnchecked (AccessibilityDelegateCompat.java:148)
  at android.view.View.sendAccessibilityEventUnchecked (View.java:6275)
  at android.support.v7.widget.RecyclerView.sendAccessibilityEventUnchecked (RecyclerView.java:3304)
  at android.view.View.sendAccessibilityEventInternal (View.java:6254)
  at android.view.View$AccessibilityDelegate.sendAccessibilityEvent (View.java:23303)
  at android.support.v4.view.AccessibilityDelegateCompat.sendAccessibilityEvent (AccessibilityDelegateCompat.java:226)
  at android.support.v4.view.AccessibilityDelegateCompat$AccessibilityDelegateApi16Impl$1.sendAccessibilityEvent (AccessibilityDelegateCompat.java:143)

崩溃2

java.lang.AbstractMethodError: 
  at android.text.TextUtils.writeToParcel (TextUtils.java:654)
  at android.os.Parcel.writeCharSequence (Parcel.java:586)
  at android.view.accessibility.AccessibilityNodeInfo.writeToParcel (AccessibilityNodeInfo.java:2795)
  at android.os.Parcel.writeTypedList (Parcel.java:1222)
  at android.view.accessibility.IAccessibilityInteractionConnectionCallback$Stub$Proxy.setFindAccessibilityNodeInfosResult (IAccessibilityInteractionConnectionCallback.java:140)
  at android.view.AccessibilityInteractionController.findAccessibilityNodeInfoByAccessibilityIdUiThread (AccessibilityInteractionController.java:168)
  at android.view.AccessibilityInteractionController.-wrap1 (AccessibilityInteractionController.java)
  at android.view.AccessibilityInteractionController$PrivateHandler.handleMessage (AccessibilityInteractionController.java:1198)
  at android.os.Handler.dispatchMessage (Handler.java:110)
  at android.os.Looper.loop (Looper.java:203)
  at android.app.ActivityThread.main (ActivityThread.java:6343)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1084)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:945)

任何帮助都非常感谢。

1 个答案:

答案 0 :(得分:0)

我为我的文本创建了自定义跨度,实现了“ParcelableSpan”创建了这些错误

我最初的实施是

public class NativeArticleBulletSpan  implements LeadingMarginSpan, ParcelableSpan 

查看ParcelableSpan的文档后 https://developer.android.com/reference/android/text/ParcelableSpan.html 其中说“这只能由框架中的代码使用;它不适用于应用程序实现自己的Parcelable跨度。”

我已将自定义范围实施更改为以下修复错误

public class NativeArticleBulletSpan implements LeadingMarginSpan