Cocos2dx v3.7 JavaScript game crashes on Android

  • efares
    Likes 0

    Problem Description

    Hi,

    I have developer my first game using Cocos2dx v3.7 in JavaScript and have deployed it to the Android platform. I have submitted my apk to the Google Play Store and put the game in beta to test it out with my friends.

    Some of them have told me their game just crashes mid way as they're playing. I'm not exactly sure what is causing the crash but here are the native crash logs that Google Play Developer Console is showing me:
    1

        *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
        Build fingerprint: 'samsung/nobleltebmc/nobleltebmc:5.1.1/LMY47X/N920W8VLU2AOK5:user/release-keys'
        Revision: '9'
        ABI: 'arm'
        pid: 26580, tid: 26683, name: GLThread 10643  >>> rocky.race.game <<<
        signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x3926
            r0 eee12840  r1 dc7ffb58  r2 ffffffff  r3 00000000
            r4 eee12840  r5 00003926  r6 eee1216c  r7 db7f3b90
            r8 db7f5000  r9 eec8827c  sl e21127cc  fp eee12148
            ip 00000000  sp f37f77c8  lr e1375978  pc e136d72c  cpsr 600f0010
        
        backtrace:
            #00 pc 005d072c  /data/app/rocky.race.game-1/lib/arm/libcocos2djs.so


    2

    *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
        Build fingerprint: 'samsung/t0ltevl/t0ltecan:4.4.2/KOT49H/I317MVLUDNH3:user/release-keys'
        Revision: '10'
        pid: 27163, tid: 27186, name: Thread-1478  >>> rocky.race.game <<<
        signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 9999999a
            r0 63a66848  r1 675ded58  r2 ffffffff  r3 00000000
            r4 63a66848  r5 9999999a  r6 63a66174  r7 675435f8
            r8 67548c80  r9 63f62c7c  sl 610c67cc  fp 63a66150
            ip 00000000  sp 6261de78  lr 60329978  pc 6032172c  cpsr 60030010
            d0  0000000000000000  d1  0000000000000000
            d2  0000000000000000  d3  0000000000000000
            d4  4094980000000000  d5  437f80003d93dd98
            d6  43b440003f800000  d7  bf80000000000000
            d8  416fca0540000000  d9  416fca0555555555
            d10 0000000000000000  d11 0000000000000000
            d12 0000000000000000  d13 0000000000000000
            d14 0000000000000000  d15 0000000000000000
            d16 0000117459cf2211  d17 3ff0000000000000
            d18 bc4945bf7ffda060  d19 3fe62e4300000000
            d20 3fe62e42fefa39ef  d21 be205c610ca86c39
            d22 bf66bfcb262698a4  d23 3fecb695f172535c
            d24 bf77359d1d833c2a  d25 3ff0000000000000
            d26 be6209451ca00000  d27 3fba4b50746d6523
            d28 bf77359d1d833c27  d29 3f887d660e7c5249
            d30 be6209451ca7160a  d31 3f11551d246ea1cc
            scr 80000013
        
        backtrace:
            #00  pc 005d072c  /data/app-lib/rocky.race.game-1/libcocos2djs.so
            #01  pc 005d8974  /data/app-lib/rocky.race.game-1/libcocos2djs.so
        
        code around pc:
            6032170c e5915000 0a000005 e3a02000 e12fff33  
            6032171c e3a03000 e5843008 e584300c e8bd81f0  
            6032172c e5953000 e3c33eff e3c3300f e5933000  
            6032173c e5932000 e59219b4 e3510002 0a000025  
            6032174c e59229b4 e3520003 15d32008 0a000021  
            6032175c e3520000 08bd81f0 e3c524ff e1a01a25  
            6032176c e3c2260f e1a01a01 e1a071a2 e381193f  
            6032177c e38110a0 e207001f e3a06001 e1a02422  
            6032178c e1a00016 e791c102 e594802c e11c0000  
            6032179c 1a00000a e18c0000 e3580000 e7810102  
            603217ac 1a000012 e594201c e5941020 e1520001  
            603217bc 0a000018 e3855001 e4825004 e584201c  
            603217cc e3a02001 e5c322cb e3a03000 e5843008  
            603217dc e584300c e8bd81f0 e59322d4 e2422001  
            603217ec e3520001 83a02000 93a02001 eaffffd7  
            603217fc e0877008 e207201f e1a072a7 e1a06216  
        
        code around lr:
            60329958 e1a00005 ebfff5f0 eaffffe8 e1a00005  
            60329968 ebffe9cd eaffffe5 e1a00005 ebffe63e  
            60329978 eaffffe2 e1a0000b e1a01005 e59d2004  
            60329988 ebfffe3a e59b0000 e1a01005 eb0da7a7  
            60329998 eaffffaf e59b3000 e593a154 e5933150  
            603299a8 e083a10a e2837004 e15a0007 03a09000  
            603299b8 15933004 01a08009 1593926c 15938268  
            603299c8 10889109 e15a0007 0a000020 e4980004  
            603299d8 e5903018 e5932000 e59219b4 e3510002  
            603299e8 0a000016 e59229b4 e3520003 15d33008  
            603299f8 0a000012 e3530000 0a00000d e1590008  
            60329a08 1afffff1 e1a02007 e2877004 e15a0007  
            60329a18 0a00000e e5b23004 e5d312c9 e3510000  
            60329a28 1afffff8 e593926c e5938268 e0889109  
            60329a38 eaffffe3 e1a01005 eb08922d eaffffee  
            60329a48 e59332d4 e2933000 13a03001 eaffffe8

    Do you have any clue as to what is causing these crashes?
    Could it be that I'm adding the same child twice? Should I look for something in the libcocos2djs.so file?

    Any help would be greatly appreciated. Thanks!

  • Sonar Systems admin
    Likes 0

    What devices are they using?

  • efares
    Likes 0

    1. Galaxy Note5 (nobleltebmc) Android 5.1
    2. Galaxy Note2 (t0ltecan) Android 4.4
  • efares
    Likes 0

    I tried running it on an iPhone and it also crashed at random times. Here are the logs from xCode 7.2 running on iPhone 4s iOS 9.2:    

    //
    //  main.m
    //  simulator
    //
    //  Copyright __MyCompanyName__ 2011. All rights reserved.
    //
        
    #import 
    
    int main(int argc, char *argv[]) {
            
        NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
        int retVal = UIApplicationMain(argc, argv, nil, @"AppController"); //ERROR: Thread 1: EXC_BAD_ACCESS (code=1, adress=0x44)
        [pool release];
        return retVal;
    }

    and

    Console: listening on  0.0.0.0 : 6050
    Console: listening on  0.0.0.0 : 6060
    ------------------------------------------------
    LOAD Js FILE: main.js
    ------------------------------------------------
    warning: could not load any Objective-C class information from the dyld shared cache. This will significantly reduce the quality of type information available.
    (lldb) 

     


  • Sonar Systems admin
    Likes 0

    Does this happen with a fresh project?

  • efares
    Likes 0

    I haven’t tried a fresh project but I noticed it crashes in release mode but not in debug mode.

    Can I/Should I use Flurry analytics to get a crash report?

  • Sonar Systems admin
    Likes 0

    Try a new Cocos2d-x version.

  • efares
    Likes 0

    I tried using the new Cocos2d-x version (v.3.10 from v3.7) but it didn’t work. I am unable to open/run the game on my Android phone. I have even tried running a blank new project and it is unable to open on my Android 4.1.2.

    Steps I took to update Cocos:

    1. Downloaded new Cocos 3.10 from Cocos website
    2. Did setup.py using terminal on Mac
    3. Did cocos new test -p test.test.test -l js
    4. cd to test directory
    5. Did cocos compile -p android
    6. Moved the apk file onto my phone and tried opening it but it keeps saying “test has stopped working” when I click to open it.
  • Sonar Systems admin
    Likes 0

    Do you get any errors during compilation?

  • efares
    Likes 0

    No errors but it takes a very long time to finish compiling. It doesn’t lag or hang when I compile, it outputs logs of what it’s doing but it takes a long time compared to when I compiled using v3.7

    I think I’m going to take my project back to v3.7 and debug the crashes from there.

  • Sonar Systems admin
    Likes 0

    OK cool, keep us informed.

  • efares
    Likes 0

    Just so you know, I have 3 Android devices and my game worked on only 1 of them when I updated from 3.7 to 3.10 so it still worked on 1 out of 3 Android phones.

  • Sonar Systems admin
    Likes 0

    What were the 3 devices?

  • efares
    Likes 0

    It works on Sony M4 Aqua (Android 5.0) but does not work on LG Optimus L5 ii (Android 4.4) or Note 3

Login to reply