Android application crashes on launch (Unity 2019.4.27)

We’ve just finished transition from Unity 2018.4.31 to Unity 2019.4.27. According to our internal testing everything works fine and FPS, Memory and build size doesn’t suffer of this transition at all.
But by some reason the average rating of version with new Unity drops from 4.5 down to 3.7. According to user reviews the problem is that application doesn’t start. Using Crashlytics we have found crash with this stacktrace:

name: UnityMain >>> com.mattel.HWInfiniteLoop <<< uid: 10156 signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0 Cause: null pointer dereference

libunity.0x1ce3d4 BeginsWith(char const*, char const*)
libunity.0x28ea08 ApiGLES::FillExtensions(dynamic_array<core::basic_string_ref, 0u>&)
libunity.0x28e608 ApiGLES::Init(GfxContextGLES const&, GfxDeviceLevelGL&)
libunity.0x27cd14 GfxDeviceGLES::Init(GfxDeviceLevelGL)
libunity.0x27c1b0 CreateGLESGfxDevice(GfxDeviceRenderer)
libunity.0x68568f CreateClientGfxDevice(GfxDeviceRenderer, GfxCreateDeviceFlags)
libunity.0x4114c8 CreateGfxDevice(GfxDeviceRenderer, GfxCreateDeviceFlags)
libunity.0x411788 InitializeGfxDevice()
libunity.0x25831b AndroidGraphics::Startup()
libunity.0x24abe9 UnityInitApplication()
libunity.0x24b61d UnityPlayerLoop()
libunity.0x259585 nativeRender(_JNIEnv*, _jobject*)

This crash is not really frequent and occurs only on 0.5% of users, but nearly all those users throws 1 star rating or review :(. Also this fact prevents us on reproducing this crash on our test devices. Now we have returned Unity 2018.4 build in Google Play.

Does anybody knows how to overcome this bug or knows Unity 2019.4 version which doesn’t has this bug (2019.4.25, 2019.4.26, 2019.4.28 or others)?

5 Likes

Do you know if this affects specific devices or specific Android versions?

According to crashlytics it can happen on any android version and on lots of different android devices. Also I have checked if it depends on GPU, and it looks like it’s more frequent on Mali, but Adreno GPUs also present in crash reports.

Today we discover that Unity 2018.4.31f1 also have this crash, but only for armv7 ABI (that’s why we didn’t notice it earlier).
In Unity 2019.4.27f1 it crashes on both armv7 and arm64 ABIs.

Most likely scenario is that Unity fails to create and/or use an OpenGL/EGL context during launch. It’s currently unclear why this happens.

We will continue to investigate this issue and will provide any additional information ASAP.

2 Likes

Same errors here on:
motorola Moto G (5S) Plus - Android 8.1.0
ZTE Blade A5 2020 - Android 9
Galaxy J2 Core - Android 8.1.0

I can see the same error in crashlytics. Also on start of the application.

Logs after resolving with the StacktraceUtility:

Caused by java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2019.4.19f1 (ca5b14067cec)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
Build fingerprint: 'ZTE/RU_P671F50_D/P671F50_D:9/PPR1.180610.011/20200908.014058:user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2021-08-14 22:21:05+0300
pid: 20136, tid: 20174, name: UnityMain  >>> com.xxx.xxx <<<
uid: 10119
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
    x0  0000000000000000  x1  0000007071e53b09  x2  000000000000000a  x3  ffffffffffffffff
    x4  0000007111f6cfcb  x5  00000070727e27dd  x6  0000000000000030  x7  0000000000000030
    x8  0000000000000041  x9  5d96b7d5f8c66328  x10 0000000000000001  x11 000000000000000a
    x12 8000000000000000  x13 0000000000000018  x14 0000000000000005  x15 ffffffffffffffff
    x16 0000007111f9ba30  x17 000000711036ebb8  x18 00000070727e1b5a  x19 00000070727e2900
    x20 0000006fe0543780  x21 0000000000000000  x22 0000000000000002  x23 00000070727e5588
    x24 00000070727e3970  x25 00000070727e5588  x26 00000070727e5588  x27 00000070727e2bb0
    x28 00000070727e2ff0  x29 00000070727e3f58
    sp  00000070727e2860  lr  000000707131059c  pc  00000070711856a4
backtrace:
      #00 pc 00000000005716a4 (BeginsWith(char const*, char const*) at ??:?)  /data/app/com.xxx.xxx-2mXxbPVTXMQJ4SDRstWycw==/lib/arm64/libunity.so (BuildId: caf139f1dc6960bd4b304392f3096c30610cb9dc)
      #01 pc 00000000006fc598 (ApiGLES::FillExtensions(dynamic_array<core::basic_string_ref<char>, 0ul>&) at ??:?)  /data/app/com.xxx.xxx-2mXxbPVTXMQJ4SDRstWycw==/lib/arm64/libunity.so (BuildId: caf139f1dc6960bd4b304392f3096c30610cb9dc)
      #02 pc 00000000006fc21c (ApiGLES::Init(GfxContextGLES const&, GfxDeviceLevelGL&) at ??:?)  /data/app/com.xxx.xxx-2mXxbPVTXMQJ4SDRstWycw==/lib/arm64/libunity.so (BuildId: caf139f1dc6960bd4b304392f3096c30610cb9dc)
      #03 pc 00000000006ec6a4 (GfxDeviceGLES::Init(GfxDeviceLevelGL) at ??:?)  /data/app/com.xxx.xxx-2mXxbPVTXMQJ4SDRstWycw==/lib/arm64/libunity.so (BuildId: caf139f1dc6960bd4b304392f3096c30610cb9dc)
      #04 pc 00000000006ebd80 (CreateGLESGfxDevice(GfxDeviceRenderer) at ??:?)  /data/app/com.xxx.xxx-2mXxbPVTXMQJ4SDRstWycw==/lib/arm64/libunity.so (BuildId: caf139<truncated: 1286 chars>
       at libunity.0x5716a4()
       at libunity.0x6fc598()
       at libunity.0x6fc21c()
       at libunity.0x6ec6a4()
       at libunity.0x6ebd80()
       at libunity.0x39011c()
       at libunity.0x8894f8()
       at libunity.0x889788()
       at libunity.0x657d4c()
       at libunity.0x644e5c()
       at libunity.0x645884()
       at libunity.0x659778()
       at base.0x477fc()

Caused by java.lang.Error: ************************************************
Version ‘2019.4.17f1c1 (ab9d18516a31)’, Build type ‘Release’, Scripting Backend ‘il2cpp’, CPU ‘armeabi-v7a’
Build fingerprint: ‘samsung/on5xelteub/on5xelte:8.0.0/R16NW/G570MUBS8CTF1:user/release-keys’
Revision: ‘5’
ABI: ‘arm’
Timestamp: 2021-09-29 20:59:32-0300
pid: 8525, tid: 8624, name: UnityMain >>> com.xxx.xxx <<<
uid: 10551
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
r0 00000000 r1 c5440b10 r2 00000041 r3 00000000
r4 c2f661a8 r5 c2f66544 r6 00000000 r7 c3ef8698
r8 c2f661a8 r9 c3ef9170 r10 c3ef959c r11 c3ef8698
ip e8ca8db8 sp c3ef8630 lr c4a7149c pc c495aebc
backtrace:
#00 pc 00393ebc (BeginsWith(char const*, char const*) at ??:?) /data/app/com.xxx.xxx-ij31TiNZW1ygX-QyX_muvw==/lib/arm/libunity.so (BuildId:d95dd8c3bba89be81aa236b517b19e97bbea919f)
#01 pc 004aa498 (ApiGLES::FillExtensions(dynamic_array<core::basic_string_ref, 0u>&) at ??:?) /data/app/com.xxx.xxx-ij31TiNZW1ygX-QyX_muvw==/lib/arm/libunity.so (BuildId: d95dd8c3bba89be81aa236b517b19e97bbea919f)
#02 pc 004aa0b8 (ApiGLES::Init(GfxContextGLES const&, GfxDeviceLevelGL&) at ??:?) /data/app/com.xxx.xxx-ij31TiNZW1ygX-QyX_muvw==/lib/arm/libunity.so (BuildId: d95dd8c3bba89be81aa236b517b19e97bbea919f)
#03 pc 00499370 (GfxDeviceGLES::Init(GfxDeviceLevelGL) at ??:?) /data/app/com.xxx.xxx-ij31TiNZW1ygX-QyX_muvw==/lib/arm/libunity.so (BuildId: d95dd8c3bba89be81aa236b517b19e97bbea919f)
#04 pc 00498810 (CreateGLESGfxDevice(GfxDeviceRenderer) at ??:?) /data/app/com.xxx.xxx-ij31TiNZW1ygX-QyX_muvw==/lib/arm/libunity.so (BuildId: d95dd8c3bba89be81aa236b517b19e97bbea919f)
#05 pc 0023f003 (CreateClientGfxDevice(GfxDeviceRenderer, GfxCreateDeviceFlags) at ??:?) /data/app/com.xxx.xxx-ij31TiNZW1ygX-QyX_muvw==/lib/arm/libunity.so (BuildId: d95dd8c3bba89be81aa236b517b19e97bbea919f)
#06 pc 0064f82c (CreateGfxDevice(GfxDeviceRenderer, GfxCreateDeviceFlags) at ??:?) /data/app/com.xxx.xxx-ij31TiNZW1ygX-QyX_muvw==/lib/arm/libunity.so (BuildId: d95dd8c3bba89be81aa236b517b19e97bbea919f)
#07 pc 0064faf8 (InitializeGfxDevice() at ??:?) /data/app/com.xxx.xxx-ij31TiNZW1ygX-QyX_muvw==/lib/arm/libunity.so (BuildId: d95dd8c3bba89be81aa236b517b19e97bbea919f)
#08 pc 004358db /data/app/com.xxx.xxx-ij31TiNZW1ygX<truncated: 646 chars>
at libunity.0x393ebc()
at libunity.0x4aa498()
at libunity.0x4aa0b8()
at libunity.0x499370()
at libunity.0x498810()
at libunity.0x23f003()
at libunity.0x64f82c()
at libunity.0x64faf8()
at libunity.0x4358db()
at libunity.0x4285fd()
at libunity.0x429053()
at libunity.0x436b05()
at base.0x1b0c23()

Any update on this? seeing the same reports from my users, on Unity 2021.2.8f1.

Caused by java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2021.2.8f1 (d0e5f0a7b06a)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a'
Build fingerprint: 'samsung/gteslteuc/gteslteatt:7.1.1/NMF26X/T377AUCS3BRE1:user/release-keys'
Revision: '5'
ABI: 'arm'
Timestamp: 2022-02-11 17:03:06-0500
pid: 25400, tid: 25469, name: UnityMain  >>> com.MagicCircleStudio.TruffleHogs <<<
uid: 10201
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
    r0  00000000  r1  7f198404  r2  00000041  r3  7ffffff8
    r4  7cdb1564  r5  7e5acc88  r6  7c4cb3b0  r7  7e5acc20
    r8  7cdb0c20  r9  7cdb0c20  r10 7e5acc20  r11 7cdb06ec
    ip  aaeeecf4  sp  7e5acbd0  lr  7eaabd24  pc  7e764854
backtrace:
      #00 pc 001b5854 (BeginsWith(char const*, char const*) at ??:?)  /data/app/com.MagicCircleStudio.TruffleHogs-1/lib/arm/libunity.so (BuildId: c695d4749db2cc180d49bc5534dd2a5a522fee5d)
      #01 pc 004fcd20 (ApiGLES::FillExtensions(dynamic_array<core::basic_string_ref<char>, 0u>&) at ??:?)  /data/app/com.MagicCircleStudio.TruffleHogs-1/lib/arm/libunity.so (BuildId: c695d4749db2cc180d49bc5534dd2a5a522fee5d)
      #02 pc 004fc980 (ApiGLES::Init(GfxContextGLES const&, GfxDeviceLevelGL&) at ??:?)  /data/app/com.MagicCircleStudio.TruffleHogs-1/lib/arm/libunity.so (BuildId: c695d4749db2cc180d49bc5534dd2a5a522fee5d)
      #03 pc 004ea594 (GfxDeviceGLES::Init(GfxDeviceLevelGL) at ??:?)  /data/app/com.MagicCircleStudio.TruffleHogs-1/lib/arm/libunity.so (BuildId: c695d4749db2cc180d49bc5534dd2a5a522fee5d)
      #04 pc 004e9b5c (CreateGLESGfxDevice(GfxDeviceRenderer) at ??:?)  /data/app/com.MagicCircleStudio.TruffleHogs-1/lib/arm/libunity.so (BuildId: c695d4749db2cc180d49bc5534dd2a5a522fee5d)
      #05 pc 00271379 (CreateClientGfxDevice(GfxDeviceRenderer, GfxCreateDeviceFlags) at ??:?)  /data/app/com.MagicCircleStudio.TruffleHogs-1/lib/arm/libunity.so (BuildId: c695d4749db2cc180d49bc5534dd2a5a522fee5d)
      #06 pc 004d8410 (CreateGfxDevice(GfxDeviceRenderer, GfxCreateDeviceFlags) at ??:?)  /data/app/com.MagicCircleStudio.TruffleHogs-1/lib/arm/libunity.so (BuildId: c695d4749db2cc180d49bc5534dd2a5a522fee5d)
      #07 pc 004d86d0 (InitializeGfxDevice() at ??:?)  /data/app/com.MagicCircleStudio.TruffleHogs-1/lib/arm/libunity.so (BuildId: c695d4749db2cc180d49bc5534dd2a5a522fee5d)
      #08 pc 002423e3 (AndroidGraphics::Startup() at ??:?)  /data/app/com.MagicCircleStudio.TruffleHogs-1/lib/arm/libunity.so (BuildId: c695d4749db2cc180d49bc5534dd2a5a522fee5d)
      #09 pc 00243ee5 <truncated: 488 chars>
       at libunity.0x1b5854()
       at libunity.0x4fcd20()
       at libunity.0x4fc980()
       at libunity.0x4ea594()
       at libunity.0x4e9b5c()
       at libunity.0x271379()
       at libunity.0x4d8410()
       at libunity.0x4d86d0()
       at libunity.0x2423e3()
       at libunity.0x243ee5()
       at libunity.0x2449d7()
       at libunity.0x254669()
       at base.0x9c4739()
1 Like

Do you have any solution?
I’m struggling with the same issue: https://discussions.unity.com/t/873518

1 Like

Any updates on this? This crash is really killing us atm. It happens on all Android devices and all Android versions.

Edit: Unity version 2019.4.36f1

1 Like

We are working on an improvement but since so far nobody is able to reproduce the problem we don’t know if it’s actually going to solve the core issue as described in https://discussions.unity.com/t/873518 .

Is there anything we can do to provide more info? I can’t reproduce it myself either, but I do have a few hundred crash reports on Google Play.

This seems to happen on Huawei devices, maybe that can help reproduce it.

It’s pretty weird, about a month ago I released a version of the app which didn’t have this problem. Now, some code changes later, it suddenly appeared. It’s the same Unity version - 2020.3.30f1.

I reverted all code, plugins, Unity settings, etc. back to the previous version and strangely the bug still happens. While the apk that was built a month ago is fine. They were supposed to be 100% the same, but apparently something’s different and that difference is not visible to Git.

Got it, the working build was done on a Mac, while the crashing one was done on Windows - both use the same Unity version - 2020.3.30f1. So switching to a Mac fixed it.

Also seems like I was wrong about Huawei devices - happens on others also.
But only when using Release builds, debug builds seem to be fine.

1 Like

I’m facing thousands of these errors on user devices (seen both in Google Play and in Crashlytics) since update from Unity 2018 to Unity 2020. I’m using Unity 2020.3.34 now and build is done on macOS. Happens on wide range of devices, but Google Play mostly reports Huawei devices.

Stack trace is as follows:

Caused by java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2020.3.34f1 (9a4c9c70452b)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
Build fingerprint: 'samsung/a31xx/a31:11/RP1A.200720.012/A315FXXU1CUK4:user/release-keys'
Revision: '3'
ABI: 'arm64'
Timestamp: 2022-06-26 12:39:30+0300
pid: 10269, tid: 12315, name: UnityMain  >>> bundle.id <<<
uid: 10255
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
Cause: null pointer dereference
    x0  0000000000000000  x1  0000007bd6e5188e  x2  0000007cdcf4a627  x3  0000000000000005
    x4  0000000000000000  x5  0000aa0000101000  x6  0000000000000000  x7  ff7f7f7fffff7fff
    x8  0000000000000041  x9  e12b387ceabd4dae  x10 0000000000000000  x11 0000007bde90e071
    x12 0000000000000000  x13 0000000000000047  x14 0000000000000001  x15 00003e04809d99b9
    x16 0000007cdcf7d9b0  x17 0000007cdcf55670  x18 000000007c5ec72c  x19 0000007bde90e180
    x20 0000007b30d39c18  x21 0000007b302cefc0  x22 0000000000000000  x23 0000000000000001
    x24 0000007bde90ee10  x25 0000007bde910000  x26 0000007bde910000  x27 0000007bde90e8c0
    x28 0000000000000001  x29 0000000000000001
    sp  0000007bde90e100  lr  0000007bd626037c  pc  0000007bd60bed48
backtrace:
      #00 pc 00000000005bad48 (BeginsWith(char const*, char const*) at ??:?)  /data/app/~~qFH1LQV0MwsoUCykyBnTqw==/bundle.id-Pn6SiNxzh4Yy6Zyhw2vKvg==/lib/arm64/libunity.so (BuildId: 53994a4518c674de19e889c82b6bb22a2875a971)
      #01 pc 000000000075c378 (ApiGLES::FillExtensions(dynamic_array<core::basic_string_ref<char>, 0ul>&) at ??:?)  /data/app/~~qFH1LQV0MwsoUCykyBnTqw==/bundle.id-Pn6SiNxzh4Yy6Zyhw2vKvg==/lib/arm64/libunity.so (BuildId: 53994a4518c674de19e889c82b6bb22a2875a971)
      #02 pc 000000000075c028 (ApiGLES::Init(GfxContextGLES const&, GfxDeviceLevelGL&) at ??:?)  /data/app/~~qFH1LQV0MwsoUCykyBnTqw==/bundle.id-Pn6SiNxzh4Yy6Zyhw2vKvg==/lib/arm64/libunity.so (BuildId: 53994a4518c674de19e889c82b6bb22a2875a971)
      #03 pc 000000000074b4cc (GfxDeviceGLES::Init(GfxDeviceLevelGL) at ??:?)  /data/app/~~qFH1LQV0MwsoUCykyBnTqw==/bundle.id-Pn6SiNxzh4Yy6Zyhw2vKvg==/lib/arm64/libunity.so (BuildId: 53994a4518c674de19e889c82b6bb22a2875a971)
      #04 pc 000000000074ab1c  /da<truncated: 1613 chars>
       at libunity.0x5bad48()
       at libunity.0x75c378()
       at libunity.0x75c028()
       at libunity.0x74b4cc()
       at libunity.0x74ab1c()
       at libunity.0x3ddc08()
       at libunity.0x8f2504()
       at libunity.0x8f276c()
       at libunity.0x6a8c5c()
       at libunity.0x6928f4()
       at libunity.0x6934a4()
       at libunity.0x6aaa10()
       at base.0xc79ac()

Got the simliar problem here , which greatly boost my game’s crash rate,anyone can help ?

java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
Version '2020.3.32f1c1 (76260b79758e)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
Build fingerprint: 'HUAWEI/DUB-LX1/HWDUB-Q:8.1.0/HUAWEIDUB-LX1/168(C432):user/release-keys'
Revision: '0'
ABI: 'arm64'
Timestamp: 2022-06-27 21:11:00+0300
pid: 8318, tid: 8359, name: UnityMain  >>> com.werwer.ggame <<<
uid: 10306
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x13a
Cause: null pointer dereference
x0  00000074f002ff70  x1  00000074f15725c0  x2  0000000000000009  x3  0000007575bcc4f1
x4  0000000000000117  x5  0000007572b1f368  x6  00000074f146a380  x7  00000074f146a380
x8  0000000000000008  x9  ffffffffffffffff  x10 00000074f1417150  x11 0000000000000102
x12 00000000ffffffff  x13 000000000000002d  x14 00000074f00e15d0  x15 0000000000000008
x16 0000007575e6c1e8  x17 000000761951d8f0  x18 0000007574aff000  x19 00000074f15725c0
x20 00000074f1662000  x21 00000075103da310  x22 0000007575e9c808  x23 00000074f0122a00
x24 0000007575e6dc78  x25 0000000000000001  x26 0000000014429ec0  x27 0000000000000000
x28 000000006fc5e250  x29 000000006fde1d70
sp  0000007572b1f7c0  lr  000000757502b194  pc  00000075750289c8
backtrace:
  at
  at
  at
  at
  at
  at
  at
  at
  at
  at
  at
  at
  at
  at
  at
  at libunity.0x2e29c8 (Native Method)
  at libunity.0x2e5190 (Native Method)
  at libunity.0x2792b8 (Native Method)
  at libunity.0x279e7c (Native Method)
  at libunity.0x28ff88 (Native Method)
  at libunity.0x28fd94 (Native Method)
  at libunity.0x290d00 (Native Method)
  at libunity.0x291378 (Native Method)
  at libunity.0x291668 (Native Method)
  at libunity.0x283f68 (Native Method)
  at libunity.0x283f9c (Native Method)
  at libunity.0x2841e0 (Native Method)
  at libunity.0x3a6010 (Native Method)
  at libunity.0x3ba88c (Native Method)
  at base.0xa522c (Native Method)

Unity 2022.2.0a17 has a potential fix for the crash on startup in ApiGLES::FillExtensions. We still have no way to reproduce the problem, so not sure if the issue is actually fixed.

I upgraded to Unity 2021.3.5f1 (Windows) and the problem disappeared for me.

My team released this morning (unity 2021.3.5) and we are being submerged with crashes.

1 Like