Android Recycle View LogCat:找不到方法

前端之家收集整理的这篇文章主要介绍了Android Recycle View LogCat:找不到方法前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用 Android支持库中的RecyclerView.在使用Android 4.1.2(API 16)的三星Galaxy S2上运行时,一切正常但在Logcat中我看到了消息:
03-24 I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.isUpdated ()Z from Lnet/mytest/TransactionsAdapter$TransactionsAdapterViewHolder;)
03-24 I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.isUpdated,referenced from method net.mytest.TransactionsAdapter$TransactionsAdapterViewHolder.access$super
03-24 W/dalvikvm: VFY: unable to resolve virtual method 16775: Landroid/support/v7/widget/RecyclerView$ViewHolder;.isUpdated ()Z
03-24 D/dalvikvm: VFY: replacing opcode 0x6f at 0x0031
03-24 I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.flagRemovedAndOffsetPosition (IIZ)V from Lnet/mytest/TransactionsAdapter$TransactionsAdapterViewHolder;)
03-24 I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.flagRemovedAndOffsetPosition,referenced from method net.mytest.TransactionsAdapter$TransactionsAdapterViewHolder.access$super
03-24 W/dalvikvm: VFY: unable to resolve virtual method 16759: Landroid/support/v7/widget/RecyclerView$ViewHolder;.flagRemovedAndOffsetPosition (IIZ)V
03-24 D/dalvikvm: VFY: replacing opcode 0x6f at 0x0053
03-24 I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.isRemoved ()Z from Lnet/mytest/TransactionsAdapter$TransactionsAdapterViewHolder;)
03-24 I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.isRemoved,referenced from method net.mytest.TransactionsAdapter$TransactionsAdapterViewHolder.access$super
03-24 W/dalvikvm: VFY: unable to resolve virtual method 16772: Landroid/support/v7/widget/RecyclerView$ViewHolder;.isRemoved ()Z
03-24 D/dalvikvm: VFY: replacing opcode 0x6f at 0x0058
03-24 I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.clearPayload ()V from Lnet/mytest/TransactionsAdapter$TransactionsAdapterViewHolder;)
03-24 I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.clearPayload,referenced from method net.mytest.TransactionsAdapter$TransactionsAdapterViewHolder.access$super
03-24 W/dalvikvm: VFY: unable to resolve virtual method 16754: Landroid/support/v7/widget/RecyclerView$ViewHolder;.clearPayload ()V
03-24 D/dalvikvm: VFY: replacing opcode 0x6f at 0x007c
03-24 I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.isAdapterPositionUnknown ()Z from Lnet/mytest/TransactionsAdapter$TransactionsAdapterViewHolder;)
03-24 I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.isAdapterPositionUnknown,referenced from method net.mytest.TransactionsAdapter$TransactionsAdapterViewHolder.access$super
03-24 W/dalvikvm: VFY: unable to resolve virtual method 16768: Landroid/support/v7/widget/RecyclerView$ViewHolder;.isAdapterPositionUnknown ()Z
03-24 D/dalvikvm: VFY: replacing opcode 0x6f at 0x0086
03-24 I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.offsetPosition (IZ)V from Lnet/mytest/TransactionsAdapter$TransactionsAdapterViewHolder;)
03-24 I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.offsetPosition,referenced from method net.mytest.TransactionsAdapter$TransactionsAdapterViewHolder.access$super
03-24 W/dalvikvm: VFY: unable to resolve virtual method 16777: Landroid/support/v7/widget/RecyclerView$ViewHolder;.offsetPosition (IZ)V
03-24 D/dalvikvm: VFY: replacing opcode 0x6f at 0x00ad
03-24 I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.shouldIgnore ()Z from Lnet/mytest/TransactionsAdapter$TransactionsAdapterViewHolder;)
03-24 I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.shouldIgnore,referenced from method net.mytest.TransactionsAdapter$TransactionsAdapterViewHolder.access$super
03-24 W/dalvikvm: VFY: unable to resolve virtual method 16786: Landroid/support/v7/widget/RecyclerView$ViewHolder;.shouldIgnore ()Z
03-24 D/dalvikvm: VFY: replacing opcode 0x6f at 0x00b9
03-24 I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.setFlags (II)V from Lnet/mytest/TransactionsAdapter$TransactionsAdapterViewHolder;)
03-24 I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.setFlags,referenced from method net.mytest.TransactionsAdapter$TransactionsAdapterViewHolder.access$super
03-24 W/dalvikvm: VFY: unable to resolve virtual method 16782: Landroid/support/v7/widget/RecyclerView$ViewHolder;.setFlags (II)V
03-24 D/dalvikvm: VFY: replacing opcode 0x6f at 0x00d4
03-24 I/dalvikvm: DexOpt: illegal method access (call Landroid/support/v7/widget/RecyclerView$ViewHolder;.addChangePayload (Ljava/lang/Object;)V from Lnet/mytest/TransactionsAdapter$TransactionsAdapterViewHolder;)
03-24 I/dalvikvm: Could not find method android.support.v7.widget.RecyclerView$ViewHolder.addChangePayload,referenced from method net.mytest.TransactionsAdapter$TransactionsAdapterViewHolder.access$super
03-24 W/dalvikvm: VFY: unable to resolve virtual method 16751: Landroid/support/v7/widget/RecyclerView$ViewHolder;.addChangePayload (Ljava/lang/Object;)V
03-24 D/dalvikvm: VFY: replacing opcode 0x6f at 0x00dc

我应该担心这个消息吗?

解决方法

看看这个答案 https://stackoverflow.com/a/18600156/1852441

基本上,你没有调用正确的方法.您将不得不调用相应的“支持方法.

例如.从v14调用getActionBar()而不是从v7调用getSupportActionBar()将导致此问题.

确保调用支持方法,此错误将消失.

原文链接:https://www.f2er.com/android/315123.html

猜你在找的Android相关文章