我的应用在任何Google设备上都运行良好。但当我尝试在Kindle fire
上运行时,它崩溃了。就在崩溃发生之前,活动监视器日志显示,大约有15-20个以com.amazon
开头的进程停止运行,并计划重新启动。然后,我的应用(在前台运行)崩溃并尝试重新启动:
04-25 15:56:00.487: I/ActivityManager(861): Process com.qualcomm.wfd.service:wfd_service (pid 13715) has died.
04-25 15:56:00.517: I/ActivityManager(861): Process com.qualcomm.wiper (pid 13903) has died.
04-25 15:56:00.517: W/ActivityManager(861): Scheduling restart of crashed service com.qualcomm.wiper/.Wiper in 44738ms
04-25 15:56:00.567: I/WindowState(861): WIN DEATH: Window{421cb828 u0 com.amazon.kindle.otter/com.amazon.kindle.otter.Launcher}
04-25 15:56:00.567: I/ActivityManager(861): Process com.amazon.kindle.otter (pid 15113) has died.
04-25 15:56:00.737: I/ActivityManager(861): Process com.audible.application.kindle (pid 12920) has died.
04-25 15:56:00.737: W/ActivityManager(861): Scheduling restart of crashed service com.audible.application.kindle/com.audible.application.download.service.DownloadManagerService in 54521ms
04-25 15:56:00.737: W/ActivityManager(861): Scheduling restart of crashed service com.audible.application.kindle/com.audible.application.services.PlayerService in 64521ms
04-25 15:56:00.737: W/ActivityManager(861): Scheduling restart of crashed service com.audible.application.kindle/com.audible.application.AudibleContentManagementService in 74521ms
04-25 15:56:00.737: W/ActivityManager(861): Scheduling restart of crashed service com.audible.application.kindle/com.audible.application.media.AudioPlayerService in 84521ms
04-25 15:56:00.817: I/ActivityManager(861): Process com.amazon.zico (pid 13321) has died.
04-25 15:56:00.817: W/ActivityManager(861): Scheduling restart of crashed service com.amazon.zico/.service.LocalFileObserverService in 94443ms
04-25 15:56:00.857: I/ActivityManager(861): Process com.amazon.webview (pid 14116) has died.
04-25 15:56:00.857: W/ActivityManager(861): Scheduling restart of crashed service com.amazon.webview/.WarmupService in 94402ms
04-25 15:56:00.897: I/ActivityManager(861): Process com.ivona.tts.oem (pid 14231) has died.
04-25 15:56:00.897: W/ActivityManager(861): Scheduling restart of crashed service com.ivona.tts.oem/com.ivona.ttslib.engine.TTSServiceActivation in 104365ms
04-25 15:56:01.077: I/ActivityManager(861): Process com.amazon.platform (pid 14652) has died.
04-25 15:56:01.077: W/ActivityManager(861): Scheduling restart of crashed service com.amazon.platform/com.amazon.geo.platform.GeoDeviceService in 114186ms
04-25 15:56:01.117: I/ActivityManager(861): Process com.nokia.odnp.service:remote (pid 14738) has died.
04-25 15:56:01.117: W/ActivityManager(861): Scheduling restart of crashed service com.nokia.odnp.service/.OdnpService in 124145ms
04-25 15:56:01.397: I/ActivityManager(861): Process com.amazon.kindle.cms (pid 12817) has died.
04-25 15:56:01.397: W/ActivityManager(861): Scheduling restart of crashed service com.amazon.kindle.cms/.CMSService in 133859ms
04-25 15:56:01.397: W/ActivityManager(861): Scheduling restart of crashed service com.amazon.kindle.cms/.MaintenanceService in 143858ms
04-25 15:56:01.487: I/ActivityManager(861): Process com.nuance.swype.input:SwypeConnect (pid 12837) has died.
04-25 15:56:01.487: W/ActivityManager(861): Scheduling restart of crashed service com.nuance.swype.input/com.nuance.swype.connect.ConnectClient in 0ms
04-25 15:56:01.487: I/ActivityManager(861): Start proc com.nuance.swype.input:SwypeConnect for service com.nuance.swype.input/com.nuance.swype.connect.ConnectClient: pid=15792 uid=32062 gids={72062, 3003, 1015, 3002, 1028, 9001}
04-25 15:56:01.607: I/ActivityManager(861): Start proc com.amazon.kindle.cms for service com.amazon.kindle.cms/.CMSService: pid=15810 uid=32092 gids={72092, 1015, 3003, 1028, 9001}
04-25 15:56:01.657: I/ActivityManager(861): Process com.android.inputmethod.latin (pid 15740) has died.
04-25 15:56:01.657: W/ActivityManager(861): Scheduling restart of crashed service com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService in 153603ms
04-25 15:56:01.757: I/ActivityManager(861): Start proc com.amazon.device.settings:Settings for content provider com.amazon.device.settings/.SettingsProvider: pid=15830 uid=32086 gids={72086, 3003, 1028, 9001}
04-25 15:56:02.227: I/ActivityManager(861): Process com.theatavist.atavist (pid 15290) has died.
04-25 15:56:02.227: I/WindowState(861): WIN DEATH: Window{422de940 u0 com.theatavist.atavist/net.atavist.android.LaunchActivity}
04-25 15:56:02.237: W/ActivityManager(861): Force removing ActivityRecord{42941990 u0 com.theatavist.atavist/net.atavist.android.view.testPaging.TestPagerActivity}: app died, no saved state
04-25 15:56:02.237: I/WindowState(861): WIN DEATH: Window{423b0b38 u0 com.theatavist.atavist/net.atavist.android.StoreActivity}
04-25 15:56:02.247: I/WindowState(861): WIN DEATH: Window{4273e5c8 u0 com.theatavist.atavist/net.atavist.android.view.testPaging.TestPagerActivity}
04-25 15:56:02.247: V/DoNotDisturb(861): Top component: com.theatavist.atavist/net.atavist.android.StoreActivity
04-25 15:56:02.267: I/ActivityManager(861): Start proc com.theatavist.atavist for activity com.theatavist.atavist/net.atavist.android.StoreActivity: pid=15877 uid=10000 gids={50000, 1015, 3003, 1028}
04-25 15:56:02.297: D/WindowManager(861): openingActivityName = net.atavist.android.StoreActivity, animAttr = 4
04-25 15:56:02.297: V/DoNotDisturb(861): Top component: com.theatavist.atavist/net.atavist.android.StoreActivity
04-25 15:56:02.317: W/Settings(861): Setting default_input_method has moved from android.provider.Settings.Secure to android.provider.Settings.Global.
04-25 15:56:02.337: D/ProfileManager(15877): Create ProfileManager instance
04-25 15:56:02.357: D/SurfaceTexture(424): [Starting com.theatavist.atavist] setFilteringEnabled called with mCurrentTextureBuf == NULL
04-25 15:56:02.367: I/Activity(15877): Constructing ActvityExender com.amazon.android.app.AmazonActivityExtender.
04-25 15:56:02.367: I/Activity(15877): Constructed ActvityExender com.amazon.android.app.AmazonActivityExtender.
没有关于崩溃本身的描述,所以我不知道如何修复。有人有什么想法吗?
1条答案
按热度按时间jjjwad0x1#
可能是ANR。
我有一套大约400个单元测试,在其他各种设备(包括亚马逊Phone Fire)上运行良好,但在亚马逊Kindle Fire HDX 7”上失败。
当这个“崩溃”发生时,没有java堆栈跟踪,也没有c堆栈跟踪。崩溃从来不会发生在同一个测试上。而且,很明显,单独运行这些单元测试从来不会导致问题。
当进程最终退出时,除了正常的单元测试之外,没有太多的宣传。例如,有一个WIN DEATH日志行,然而,即使单元测试成功运行完成,它仍然宣布WIN DEATH。
不过我注意到了一些有趣的事情。当我使用以下命令监视logcat时:
我看到一整页都是这些:
当我坐在那里观看输出时,错误的速度不断增加,直到我的测试应用程序崩溃。
根据我找到的一些文档,在正常的安卓系统中,触摸事件在5秒内没有响应,或者广播接收器运行10秒都会导致ANR。但是,我不知道亚马逊对它做了什么。
我做了另一个测试,传递一个runnable到$getInstrumentation().runOnMainSync()$,忙碌在一个空while循环中等待120秒。这并没有导致应用程序被杀死,直到我点击了后退按钮。然后我看到了同样的崩溃:窗口死亡、无堆栈跟踪、无C堆栈跟踪。
此外,在原始崩溃和故意的ANR中,我都看到一行提到ActivityRecord遇到困难(不总是这行):
我试着让junit线程在每个线程之后休眠1500 ms,以为我正在让一些后台系统缺乏UI线程(我的单元测试导致在短时间内创建6,000个视图),但这没有帮助,而且也没有明显延迟崩溃。