ActionBarActivity后pressing硬件菜单按钮关闭。没有堆栈跟踪 [英] ActionBarActivity closes after pressing hardware menu button. Without stack trace
问题描述
我有一个很奇怪的问题。当我点击的硬件菜单按钮(设备与Android 2.3)后使用ActionBarActivity应用程序意外关闭,没有任何特定的错误。只有LogCat中给出了:
I have a really strange problem. When I use ActionBarActivity after clicking on hardware menu button (device with Android 2.3) the app closes unexpectedly without any particular error. Logcat gives only:
W/KeyCharacterMap﹕ No keyboard for id 0
W/KeyCharacterMap﹕ Using default keymap: /system/usr/keychars/qwerty.kcm.bin
30-30/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-19 15:54:48.612 30-30/? I/DEBUG﹕ Build fingerprint: 'generic/sdk/generic/:2.2/FRF91/43546:eng/test-keys'
03-19 15:54:48.612 30-30/? I/DEBUG﹕ pid: 785, tid: 785 >>> com.myapp <<<
03-19 15:54:48.612 30-30/? I/DEBUG﹕ signal 11 (SIGSEGV), fault addr 00000002
03-19 15:54:48.612 30-30/? I/DEBUG﹕ r0 00000000 r1 00000001 r2 00000001 r3 00000002
03-19 15:54:48.612 30-30/? I/DEBUG﹕ r4 bead28a4 r5 0000aa50 r6 001240a8 r7 0022b860
...
code:
Code:
@Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getMenuInflater();
inflater.inflate(R.menu.main, menu);
return false;
}
这个问题似乎是,如果main.xml中有任何元素。
The issue appears if main.xml has any element.
我用'com.android.support:appcompat-v7:19.0.+我的摇篮依赖。
I use 'com.android.support:appcompat-v7:19.0.+' as my gradle dependency.
所有工作正常,当我使用的活动。
推荐答案
也报道在<一个href="https://stackoverflow.com/questions/22523014/android-app-crashes-upon-menu-button-click">Android在菜单按钮的应用程序崩溃点击,这似乎是一个问题,最新的0.9.1版本的摇篮,我可以确认它杀死的升级Froyo和姜饼的应用程序。了解更多有关类似问题的这里和另一份报告这里。这个问题似乎是与新的 PNG 处理器。正如刚才uchidev,对于现在的解决方案是通过改变 build.gradle
来使用摇篮0.9.0。
Reported also at Android App crashes upon menu button click, this appears to be an issue with the latest 0.9.1 version of gradle and I can confirm that it kills apps on Froyo as well as Gingerbread. Read more about a similar problem here and another report here. The issue seems to be related to a new png processor. As mentioned by uchidev, the solution for now is to use gradle 0.9.0 by changing build.gradle
.
这是备用建议以恢复:你可以添加 android.aaptOptions.useAaptPngCruncher = TRUE
到 build.gradle
An alternate suggestion to reverting: you can add android.aaptOptions.useAaptPngCruncher = true
to build.gradle
.
更新14年3月28日:此错误似乎已被固定在机器人工作室0.5.3
Update 3/28/14: This bug seems to have been fixed in Android Studio 0.5.3.
这篇关于ActionBarActivity后pressing硬件菜单按钮关闭。没有堆栈跟踪的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!