2.2模拟器 - 应用程序关闭,无法解析虚拟方法?

时间:2012-06-13 02:56:41

标签: android actionbarsherlock

我一直在使用actionbarsherlock,它运行正常,但我只是尝试使用2.2模拟器并将此输出发送到DDMS。应用程序没有机会呈现自己一次,只是在调用一些onCreate()方法后立即关闭。有没有人见过这个?:

Style contains key with bad entry: 0x010102ce
Style contains key with bad entry: 0x010102f3
Style contains key with bad entry: 0x010102ce
Style contains key with bad entry: 0x010102f3
VFY: unable to resolve virtual method 4361: Lcom/actionbarsherlock/internal/nineoldandroids/widget/NineFrameLayout;.onHoverEvent (Landroid/view/MotionEvent;)Z
VFY: unable to resolve virtual method 3077: Landroid/widget/FrameLayout;.getAlpha ()F
VFY: unable to resolve virtual method 3078: Landroid/widget/FrameLayout;.getTranslationY ()F
VFY: unable to resolve virtual method 3081: Landroid/widget/FrameLayout;.setAlpha (F)V
VFY: unable to resolve virtual method 3089: Landroid/widget/FrameLayout;.setTranslationY (F)V
VFY: unable to resolve virtual method 317: Landroid/content/pm/PackageManager;.getActivityLogo (Landroid/content/ComponentName;)Landroid/graphics/drawable/Drawable;
VFY: unable to resolve virtual method 313: Landroid/content/pm/ApplicationInfo;.loadLogo (Landroid/content/pm/PackageManager;)Landroid/graphics/drawable/Drawable;
VFY: unable to resolve virtual method 2832: Landroid/view/ViewGroup;.getAlpha ()F
VFY: unable to resolve virtual method 2838: Landroid/view/ViewGroup;.getTranslationX ()F
VFY: unable to resolve virtual method 2839: Landroid/view/ViewGroup;.getTranslationY ()F
VFY: unable to resolve virtual method 2854: Landroid/view/ViewGroup;.setAlpha (F)V
VFY: unable to resolve virtual method 2858: Landroid/view/ViewGroup;.setTranslationX (F)V
VFY: unable to resolve virtual method 2859: Landroid/view/ViewGroup;.setTranslationY (F)V
VFY: unable to resolve virtual method 5290: Lcom/actionbarsherlock/internal/widget/ActionBarView$HomeView;.onHoverEvent (Landroid/view/MotionEvent;)Z
VFY: unable to resolve virtual method 3080: Landroid/widget/FrameLayout;.onPopulateAccessibilityEvent (Landroid/view/accessibility/AccessibilityEvent;)V
ReferenceTable overflow (max=512)
Last 10 entries in JNI local reference table:
  502: 0x43ecaca0 cls=Ljava/lang/String; (28 bytes)
  503: 0x43ecacf0 cls=Ljava/lang/String; (28 bytes)
  504: 0x43ecad40 cls=Ljava/lang/String; (28 bytes)
  505: 0x43ecad90 cls=Ljava/lang/String; (28 bytes)
  506: 0x43ecade0 cls=Ljava/lang/String; (28 bytes)
  507: 0x43ecae30 cls=Ljava/lang/String; (28 bytes)
  508: 0x43ecae80 cls=Ljava/lang/String; (28 bytes)
  509: 0x43ecaed0 cls=Ljava/lang/String; (28 bytes)
  510: 0x43ecaf20 cls=Ljava/lang/String; (28 bytes)
  511: 0x43ecaf70 cls=Ljava/lang/String; (28 bytes)
JNI local reference table summary (512 entries):
    3 of Ljava/lang/Class; 164B (2 unique)
  507 of Ljava/lang/String; 28B (507 unique)
    1 of [Ljava/lang/String; 28B
    1 of [Ljava/lang/String; 2772B
Memory held directly by tracked refs is 17324 bytes
Failed adding to JNI local ref table (has 512 entries)
VM aborting

由于

1 个答案:

答案 0 :(得分:4)

这是因为在API 11(see post)之前布局simple_list_item_activated_1不存在。

要让应用运行,您可以根据simple_list_item_activated_1创建新的列表布局,并在代码中使用它。

这是一个启动者:

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:textAppearance="?android:attr/textAppearanceLarge"
    android:minHeight="?android:attr/listPreferredItemHeight"
/>

这会让代码运行,但是当我删除

时,它看起来不太正确
android:background="?android:attr/activatedBackgroundIndicator"
来自API 11定义的

。然后我继续使用一些等效代码替换它 - 请参阅post

有一个教程解释问题here