AppCompat操作栏菜单在硬件菜单键按下时崩溃

时间:2014-03-23 06:09:47

标签: android android-actionbar android-appcompat

我正在使用appcompat库,每当我按下LG G2X 2.3.3手机上的硬菜单键时,它就会崩溃我的应用程序。 “堆栈跟踪”如下:

03-23 01:42:00.257    1106-1325/? I/ActivityManager﹕ Starting: Intent { cmp=com.example.android.supportv7/.app.ActionBarMechanics } from pid 11403
03-23 01:42:00.357  11403-11403/com.example.android.supportv7 I/dalvikvm﹕ Could not find method android.widget.LinearLayout$LayoutParams.<init>, referenced from method android.support.v7.internal.view.menu.ActionMenuView$LayoutParams.<init>
03-23 01:42:00.357  11403-11403/com.example.android.supportv7 W/dalvikvm﹕ VFY: unable to resolve direct method 9421: Landroid/widget/LinearLayout$LayoutParams;.<init> (Landroid/widget/LinearLayout$LayoutParams;)V
03-23 01:42:00.357  11403-11403/com.example.android.supportv7 D/dalvikvm﹕ VFY: replacing opcode 0x70 at 0x0000
03-23 01:42:00.357  11403-11403/com.example.android.supportv7 D/dalvikvm﹕ VFY: dead code 0x0003-0007 in Landroid/support/v7/internal/view/menu/ActionMenuView$LayoutParams;.<init> (Landroid/support/v7/internal/view/menu/ActionMenuView$LayoutParams;)V
03-23 01:42:00.497    1106-1153/? I/ActivityManager﹕ Displayed com.example.android.supportv7/.app.ActionBarMechanics: +233ms
03-23 01:42:00.847  11403-11403/com.example.android.supportv7 D/dalvikvm﹕ GC_EXTERNAL_ALLOC freed 203K, 50% free 2805K/5575K, external 2130K/2137K, paused 47ms
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ Build fingerprint: 'lge/lge_lge_star/p999:2.3.3/GRI40/lgp999-V21e.41fdc8a2:user/release-keys'
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ pid: 11403, tid: 11403  >>> com.example.android.supportv7 <<<
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000001
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ r0 00000000  r1 00000007  r2 fffffe84  r3 00000070
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ r4 0000ac40  r5 4056d0b8  r6 ad39d7a4  r7 00000001
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ r8 0014ba00  r9 002d83e8  10 00000001  fp 4388b2b8
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ ip ad39e64c  sp be9493b8  lr ad356229  pc a81152bc  cpsr 20000030
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ d0  414000003f800000  d1  3ff0000043160000
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ d2  0000000000000000  d3  0000000000000000
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ d4  bff00000bf800000  d5  0000000000000000
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ d6  0000000000000000  d7  408000003f800000
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ d8  0000000000000000  d9  0000000000000000
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ d10 0000000000000000  d11 0000000000000000
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ d12 0000000000000000  d13 0000000000000000
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ d14 0000000000000000  d15 0000000000000000
03-23 01:42:00.967    1013-1013/? I/DEBUG﹕ scr 60000012
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ #00  pc 000152bc  /system/lib/libutils.so
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ #01  lr ad356229  /system/lib/libandroid_runtime.so
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ code around pc:
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ a811529c 429ab10a 8b4bd808 8b40b143 4298b130
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ a81152ac 2000bf14 e0022001 e0002000 bdf02001
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ a81152bc 2001f990 3002f990 f99018d1 f1113003
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ a81152cc 18d00208 47700080 47706800 b10b6803
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ a81152dc e0012000 68886881 bf004770 33fff04f
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ code around lr:
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ ad356208 f8d24603 462071a0 465a4629 f1ba47b8
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ ad356218 d0590f00 7030f89d 980db32f ef0cf7cf
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ ad356228 68204601 22c0f8d0 47904620 b9104607
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ ad356238 4478484c 6821e7b4 f8d14620 22003378
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ ad356248 47984639 b9104682 44784847 980de7a8
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ stack:
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be949378  405256c0
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be94937c  00000000
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be949380  405256c0
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be949384  0000cec8
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be949388  405256c0
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be94938c  aca45b87  /system/lib/libdvm.so
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be949390  4056d0b8
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be949394  4388b2b8
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be949398  405256c0
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be94939c  aca45a6d  /system/lib/libdvm.so
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493a0  0000ac40
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493a4  4056d0b8
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493a8  ad39d7a4
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493ac  aca45a39  /system/lib/libdvm.so
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493b0  df002777
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493b4  e3a070ad
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ #00 be9493b8  00000001
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493bc  00000000
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493c0  be949400
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493c4  00000000
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493c8  00000000
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493cc  00000000
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493d0  00312ea8
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493d4  40525ee0
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493d8  be94940c
03-23 01:42:01.017    1013-1013/? I/DEBUG﹕ be9493dc  ad39d108
03-23 01:42:01.027    1013-1013/? I/DEBUG﹕ be9493e0  00000002
03-23 01:42:01.027    1013-1013/? I/DEBUG﹕ be9493e4  0014ba00
03-23 01:42:01.027    1013-1013/? I/DEBUG﹕ be9493e8  0014ba01
03-23 01:42:01.027    1013-1013/? I/DEBUG﹕ be9493ec  00000000
03-23 01:42:01.027    1013-1013/? I/DEBUG﹕ be9493f0  00000000
03-23 01:42:01.027    1013-1013/? I/DEBUG﹕ be9493f4  00000000
03-23 01:42:01.027    1013-1013/? I/DEBUG﹕ be9493f8  4056d0b8
03-23 01:42:01.027    1013-1013/? I/DEBUG﹕ be9493fc  0014ba00
03-23 01:42:01.297    1106-1131/? I/BootReceiver﹕ Copying /data/tombstones/tombstone_04 to DropBox (SYSTEM_TOMBSTONE)
03-23 01:42:01.307    1106-1112/? I/ActivityManager﹕ Process com.example.android.supportv7 (pid 11403) has died.
03-23 01:42:01.307    1106-1257/? I/WindowManager﹕ WIN DEATH: Window{40757bd8 com.example.android.supportv7/com.example.android.supportv7.Support7Demos paused=false}
03-23 01:42:01.307    1106-1257/? I/WindowManager﹕ WIN DEATH: Window{40802f98 com.example.android.supportv7/com.example.android.supportv7.app.ActionBarMechanics paused=false}
03-23 01:42:01.317    1015-1015/? D/Zygote﹕ Process 11403 terminated by signal (11)
03-23 01:42:01.317    1106-1112/? I/ActivityManager﹕ Start proc com.example.android.supportv7 for activity com.example.android.supportv7/.Support7Demos: pid=11438 uid=10088 gids={3003}

该应用程序是... / android-sdk-linux / extras / android / support / samples / Support7Demos。

我已下载支持存储库,并使用以下gradle构建文件:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath ANDROID_GRADLE_CLASSPATH
    }
}

apply plugin: 'android'
project.version = 1

android {

    compileSdkVersion 19
    buildToolsVersion ADT_BUILD_TOOLS_VERSION

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

    defaultConfig {
        versionCode 1
        versionName "1.0.0"
        minSdkVersion 10
        targetSdkVersion 19
    }

}

dependencies {
    compile 'com.android.support:support-v4:+',
            'com.android.support:appcompat-v7:+',
            'com.android.support:gridlayout-v7:+',
            'com.android.support:mediarouter-v7:+'
}

应用程序安装正常并且每个活动都会在崩溃时运行,除了具有溢出选项的操作栏活动(仅当按下硬件菜单键时)。 此外,依赖项解析为版本19.0.1。我尝试使用19.0.0版本但是也没有用。

有没有其他人遇到过此类似的东西?

一个注意事项 - 当我使用Maven构建此示例和支持库时,溢出操作有效。 (在使用gradle内置版本覆盖之前,我在同一部手机上安装了一个工作装置)

1 个答案:

答案 0 :(得分:0)

aaptOptions.useAaptPngCruncher = true添加到build.gradle