Cordova app crashing on Samsung Marshmallow phones

时间:2016-10-20 19:23:21

标签: android cordova android-6.0-marshmallow galaxy

I'm trying to teach myself JavaScript by creating an little puzzle/game app with Cordova. I've got a basic prototype thing working, and have successfully got it to build on iPhone, and it runs perfectly.

I have 3 android phones to test with, 1 Marshmallow (BLU branded), 1 Lollipop, and 1 Kitkat... and the app works perfectly on those as well. I sent the app to 2 friends on the other side of the country to test, and it crashes on their Samsung Marshmallow phones ( a Galaxy 7, and a Galaxy Edge 7). It runs for a bit, and then just crashes without any user input.

So, I tried 2 separate crash analytics plugins, Fabric and Crittercism. I can verify that both of these are working, as I can force a crash in the app, and it shows up as a crash report.

But when my friends run the app with the crash analytics, whatever is going on that makes the app blowup, it isn't triggering any reports from Fabric or Crittercism. I've tried to get the android emulator running on my PC, but unfortunately it is an AMD processor, which is missing some necessary virtualization. I can't even get the super slow ARM version of the emulator to run on my PC, it just hangs forever.

I just recently installed cordova, and took all the defaults during setup. So from what I can tell, it should be targeting android API 23 (Marshmallow). But maybe there's some other kind of build issue that is messing things up?

So I'm kind of at a loss of how to debug this problem. Short of finding someone locally who can lend me a Samsung Marshmallow phone to debug with, I can't think of anything else that would work. Does anyone have any ideas?

1 个答案:

答案 0 :(得分:0)

  1. ARM仿真器确实非常慢。我会建议第三方模拟器。我使用GenyMotion(它使用VirtualBox)。你可能会有一些运气。或者,ManyMo是基于云的解决方案,可能有用。

  2. PhoneGap / Cordova使用的系统网页视图在Android设备上差异很大,这意味着您可能会遇到Android版本和设备制造商的不同问题。我建议使用the Crosswalk plugin来缓解这些问题。请注意,这会增加APK的大小以及设备上已安装应用的占用空间。

  3. 当应用程序崩溃时,它是否真的崩溃到启动器,或者应用程序是否重新加载(或只是显示背景颜色)?我不希望Crashlytics处理JavaScript问题,除非JavaScript导致应用程序崩溃到启动器。