java Android Nexus 6 模拟器上的“不幸的是,启动器已停止”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/28885723/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-02 14:20:05  来源:igfitidea点击:

"Unfortunately, Launcher has stopped" on Android Nexus 6 emulator

javaandroidandroid-studioandroid-emulator

提问by Paymon Wang-Lotfi

When testing my 2D game on the Nexus 6 emulator, the app launches and works fine the first time. But when I close out of the app and try to reopen it, I get a "Unfortunately, Launcher has stopped" and the emulator crashes. This only happens on the Nexus 6 emulator, on other older AVDs the app reopens fine. Nothing shows up in Logcat when this happens.

在 Nexus 6 模拟器上测试我的 2D 游戏时,应用程序第一次启动并运行良好。但是当我关闭应用程序并尝试重新打开它时,我收到“不幸的是,启动器已停止”并且模拟器崩溃。这仅发生在 Nexus 6 模拟器上,在其他较旧的 AVD 上,应用程序重新打开正常。发生这种情况时,Logcat 中不会显示任何内容。

I was wondering if anyone knew why this happens and only on the Nexus 6 emulator. I have suspected the following culprits but I am not sure:

我想知道是否有人知道为什么会发生这种情况,并且仅在 Nexus 6 模拟器上。我怀疑以下罪魁祸首,但我不确定:

  1. Out of memory - I do not release any of the bitmap resources used in the game, should I be doing this and if so, should it be from the surfaceDestroyed()method?

  2. A threading issue - perhaps the thread is not being properly shut down or restarted?

  1. 内存不足 - 我没有释放游戏中使用的任何位图资源,我应该这样做surfaceDestroyed()吗?如果是这样,它应该来自方法吗?

  2. 线程问题 - 也许线程没有正确关闭或重新启动?

Any help would be appreciated!

任何帮助,将不胜感激!

回答by Paymon Wang-Lotfi

Well I figured it out, turns out if I increase the RAM and heap space in the AVD advanced settings slightly I do not have this issue.

好吧,我想通了,如果我在 AVD 高级设置中稍微增加 RAM 和堆空间,我就没有这个问题。

回答by anataliocs

On Mac here was the default install location for me:

在 Mac 上,这里是我的默认安装位置:

cd /usr/local/Cellar/android-sdk/24.1.2/tools

Then in that folder I ran

然后在那个文件夹中我跑了

android avd

Then I set the following settings RAM 1536 mb VM Heap 64 mb

然后我设置以下设置 RAM 1536 mb VM Heap 64 mb

Internal Storage 768mb SD Card 768mb

内部存储 768mb SD 卡 768mb