App crash on android phone

Hi,

For our current project, we have just updated from cocos2dx 3.8 to 3.15 without changing any codes related to the network connection.
However, from the google play console, there were many crash reports with the log as below:

native: pc 0000000000d90704 /data/app/MY_APP_NAME/lib/arm/libcocos2dcpp.so
native: pc 00000000018eda7c [heap]

We tried to reproduce this error, and so far the only time we manage to reproduce it was, while connecting the data to the api and retrieving the data, we clicked the home button and return to the app, and it crashed.
Here is log we retrieved from the crash.

06-21 23:43:39.249 19246-19246/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
06-21 23:43:39.259 19246-19246/? A/DEBUG: r0 d691d1d8 r1 00000000 r2 d691d1d8 r3 00000000
06-21 23:43:39.259 19246-19246/? A/DEBUG: r4 d615fa00 r5 cd262368 r6 12c85920 r7 12c85920
06-21 23:43:39.259 19246-19246/? A/DEBUG: r8 12ca30a0 r9 e3b92100 sl 7ed02488 fp d691d1f4
06-21 23:43:39.259 19246-19246/? A/DEBUG: ip 00000001 sp d691d1c0 lr d542f600 pc d5b44c60 cpsr 600f0030
06-21 23:43:39.267 19246-19246/? A/DEBUG: backtrace:
06-21 23:43:39.269 19246-19246/? A/DEBUG: #00 pc 023b0c60 /data/app/MY_APP_NAME/lib/arm/libcocos2dcpp.so
06-21 23:43:39.269 19246-19246/? A/DEBUG: #01 pc 00554884 [anon:libc_malloc:cb980000]
06-21 23:43:41.183 397-397/? E/lowmemorykiller: Error writing /proc/18286/oom_score_adj; errno=22
[ 06-21 23:43:41.187 363: 363 W/ ]
debuggerd: resuming target 18286
06-21 23:43:41.266 924-2767/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=23, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ]
06-21 23:43:41.267 924-2752/? E/InputDispatcher: channel ‘cdf7ff2 MY_APP_NAME_Activity (server)’ ~ Channel is unrecoverably broken and will be disposed!
06-21 23:43:41.268 924-2767/? E/ConnectivityService: RemoteException caught trying to send a callback msg for NetworkRequest [ id=24, legacyType=-1, [ Capabilities: INTERNET&NOT_RESTRICTED&TRUSTED] ]

However, we do think that it also occur without pressing the home button.
May I ask do anyone know the reason for this crash? And ways to solve it?

Thank you very much

actually this crash not giving anything:) - always provide fulll log - as probably error could be somewhere else. Also 3.8 to 3.15 is huge step, even Appdelegate was changed - so it should not be just replacing cocos2d folder, also it depends which ndk u using, android version, have u cleaned old compile files and so on, also could be that changd JSOn parser or something like that. Also if u using for example webosckets they version could be changed also… so inspect your code :wink: Also move to cocos2d-x 3.15.1 because then u will able to breakpoint it with android studio

Thank you for the reply and suggestions! :smile:
We are using ndk-r10e and the build are always cleaned first before building.
Actually that’s the only log we got when it crashed.
Previously, most logs tells us which class did the crash occurred, but this time it didn’t. That is why we weren’t very sure.
However, we suspect that it is because of low memory as we managed to reproduce the crash when the app is connecting to the api when memory hit its peak. So, we are giving it a try to remove cache data right before a connection.

May I ask what is the best way to update the library?
Because cocos2dx is updated very often and it will be really hard for us to update the cocos library in the app as often as cocos2dx gets updated.

if you mean third pary, it is just runnind downoad-deps.py otherwise u not need to update cocos until u feel something new was added in cocos and u need it in your project.