Instant crash, only after installing AAB from Google Play. APK & WebGL builds work with no errors

Hello! When I test my game in editor, build to WebGL and host on my site, or via local APK install, I get no crashes or errors.

When I upload AAB too Google Play (the now required format by google) and install the game via the AAB, I get an insta-crash 100% of the time. Tested on OnePlus 7 Pro

I am currently using 2019.4, but I believe I was on some version of 2018 when I first created the project a long time ago. Unsure if that matters.

Any advice? I’ve been completely blocked by this for months since I have no idea why it’s crashing only when I build and upload as an AAB! Thanks!

Here is what I get from log cat:

09-28 11:16:27.353 10944 10944 E AndroidRuntime: FATAL EXCEPTION: main
09-28 11:16:27.353 10944 10944 E AndroidRuntime: Process: com.MyCompanyName.MyGameName, PID: 10944
09-28 11:16:27.353 10944 10944 E AndroidRuntime: java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-28 11:16:27.353 10944 10944 E AndroidRuntime: Version '2019.4.28f1 (1381962e9d08)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
09-28 11:16:27.353 10944 10944 E AndroidRuntime: Build fingerprint: 'OnePlus/OnePlus7Pro/OnePlus7Pro:9/PKQ1.190110.001/1906160616:user/release-keys'
09-28 11:16:27.353 10944 10944 E AndroidRuntime: Revision: '0'
09-28 11:16:27.353 10944 10944 E AndroidRuntime: ABI: 'arm64'
09-28 11:16:27.353 10944 10944 E AndroidRuntime: Timestamp: 2021-09-28 11:16:22-0400
09-28 11:16:27.353 10944 10944 E AndroidRuntime: pid: 10944, tid: 10992, name: UnityGfxDeviceW  >>> com.MyCompanyName.MyGameName <<<
09-28 11:16:27.353 10944 10944 E AndroidRuntime: uid: 10278
09-28 11:16:27.353 10944 10944 E AndroidRuntime: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
09-28 11:16:27.353 10944 10944 E AndroidRuntime: Cause: null pointer dereference
09-28 11:16:27.353 10944 10944 E AndroidRuntime:     x0  0000000000000000  x1  00000077b4a11040  x2  00000000007fffe0  x3  0000000000000000
09-28 11:16:27.353 10944 10944 E AndroidRuntime:     x4  0000000000000010  x5  fffffffffffffff0  x6  00000077b4a11020  x7  0000000000000000
09-28 11:16:27.353 10944 10944 E AndroidRuntime:     x8  0000000000000000  x9  0000000000800000  x10 0000000000000001  x11 00000077b4a11020
09-28 11:16:27.353 10944 10944 E AndroidRuntime:     x12 0000000000000000  x13 00000078d0540010  x14 0000000000000001  x15 0000000000000020
09-28 11:16:27.353 10944 10944 E AndroidRuntime:     x16 000000795219ca78  x17 00000079f2d35280  x18 0000000000000010  x19 00000077b4a11020
09-28 11:16:27.353 10944 10944 E AndroidRuntime:     x20 00000078800041b0  x21 0000000000000001  x22 0000000000000800  x23 0000000000000000
09-28 11:16:27.353 10944 10944 E AndroidRuntime:     x24 0000000000001000  x25 0000000000000036  x26 0000000000800000  x27 0000000000010dd8
09-28 11:16:27.353 10944 10944 E AndroidRuntime:     x28 0000000000000000  x29 0000000000000000
09-28 11:16:27.353 10944 10944 E AndroidRuntime:     sp  00000079394dac10  lr  00000079512f2bac  pc  00000079f2d354f0
09-28 11:16:27.353 10944 10944 E AndroidRuntime:
09-28 11:16:27.353 10944 10944 E AndroidRuntime: backtrace:
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #00 pc 000000000001f4f0 (libc.so not found)  /system/lib64/libc.so (memcpy+624) (BuildId: 6f8b677cd8c3defb4a727b57677c91ad)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #01 pc 000000000076cba8 (TransformHierarchyChangeDispatch::RecalculatePermanentInterests(TransformAccess) at ??:?)  /data/app/com.MyCompanyName.MyGameName-zlKy75HWXmghROBZiX4Ipg==/lib/arm64/libunity.so (BuildId: 7f44ab8514291a0995548f41d0f2ac45c93a157d)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #02 pc 000000000076c0f4 (TransformInternal::CreateTransformHierarchy(unsigned int, MemLabelId) at ??:?)  /data/app/com.MyCompanyName.MyGameName-zlKy75HWXmghROBZiX4Ipg==/lib/arm64/libunity.so (BuildId: 7f44ab8514291a0995548f41d0f2ac45c93a157d)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #03 pc 000000000076bfb4 (TransformInternal::CreateTransformHierarchy(unsigned int, MemLabelId) at ??:?)  /data/app/com.MyCompanyName.MyGameName-zlKy75HWXmghROBZiX4Ipg==/lib/arm64/libunity.so (BuildId: 7f44ab8514291a0995548f41d0f2ac45c93a157d)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #04 pc 0000000000725834 (LoadGpuProgramFromData(unsigned char const*, unsigned char const*, unsigned int&, ShaderKeywordData&, MemLabelId) at ??:?)  /data/app/com.MyCompanyName.MyGameName-zlKy75HWXmghROBZiX4Ipg==/lib/arm64/libunity.so (BuildId: 7f44ab8514291a0995548f41d0f2ac45c93a157d)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #05 pc 0000000000725b44 (LoadGpuProgramFromData(unsigned char const*, unsigned char const*, unsigned int&, ShaderKeywordData&, MemLabelId) at ??:?)  /data/app/com.MyCompanyName.MyGameName-zlKy75HWXmghROBZiX4Ipg==/lib/arm64/libunity.so (BuildId: 7f44ab8514291a0995548f41d0f2ac45c93a157d)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #06 pc 00000000003a9f70 (FileSystemEntry::FolderExists() const at ??:?)  /data/app/com.MyCompanyName.MyGameName-zlKy75HWXmghROBZiX4Ipg==/lib/arm64/libunity.so (BuildId: 7f44ab8514291a0995548f41d0f2ac45c93a157d)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #07 pc 00000000003b14b8 (SuiteVirtualFileSystemkIntegrationTestCategory::TestFileSystemEnumeratorEnumerate_WithSkipBlacklist_SkipsEntriesWithNamesFromBlackListHelper::RunImpl() at ??:?)  /data/app/com.MyCompanyName.MyGameName-zlKy75HWXmghROBZiX4Ipg==/lib/arm64/libunity.so (BuildId: 7f44ab8514291a0995548f41d0f2ac45c93a157d)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #08 pc 00000000003a8564 (SuiteLocalFileSystemkIntegrationTestCategory::TestSetFileTimeStamp_WillSetLastModifiedTimeStampHelper::RunImpl() at ??:?)  /data/app/com.MyCompanyName.MyGameName-zlKy75HWXmghROBZiX4Ipg==/lib/arm64/libunity.so (BuildId: 7f44ab8514291a0995548f41d0f2ac45c93a157d)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #09 pc 0000000000591b48 (SuiteIntersectionkUnitTestCategory::TestTransformedAABBSphere::RunImpl() const at ??:?)  /data/app/com.MyCompanyName.MyGameName-zlKy75HWXmghROBZiX4Ipg==/lib/arm64/libunity.so (BuildId: 7f44ab8514291a0995548f41d0f2ac45c93a157d)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #10 pc 00000000000901b4 (libc.so not found)  /system/lib64/libc.so (__pthread_start(void*)+36) (BuildId: 6f8b677cd8c3defb4a727b57677c91ad)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:       #11 pc 0000000000023bf8 (libc.so not found)  /system/lib64/libc.so (__start_thread+68) (BuildId: 6f8b677cd8c3defb4a727b57677c91ad)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libc.memcpy(memcpy:624)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libunity.0x76cba8 (TransformHierarchyChangeDispatch::RecalculatePermanentInterests(TransformAccess) at ??:?)(Native Method)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libunity.0x76c0f4 (TransformInternal::CreateTransformHierarchy(unsigned int, MemLabelId) at ??:?)(Native Method)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libunity.0x76bfb4 (TransformInternal::CreateTransformHierarchy(unsigned int, MemLabelId) at ??:?)(Native Method)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libunity.0x725834 (LoadGpuProgramFromData(unsigned char const*, unsigned char const*, unsigned int&, ShaderKeywordData&, MemLabelId) at ??:?)(Native Method)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libunity.0x725b44 (LoadGpuProgramFromData(unsigned char const*, unsigned char const*, unsigned int&, ShaderKeywordData&, MemLabelId) at ??:?)(Native Method)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libunity.0x3a9f70 (FileSystemEntry::FolderExists() const at ??:?)(Native Method)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libunity.0x3b14b8 (SuiteVirtualFileSystemkIntegrationTestCategory::TestFileSystemEnumeratorEnumerate_WithSkipBlacklist_SkipsEntriesWithNamesFromBlackListHelper::RunImpl() at ??:?)(Native Method)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libunity.0x3a8564 (SuiteLocalFileSystemkIntegrationTestCategory::TestSetFileTimeStamp_WillSetLastModifiedTimeStampHelper::RunImpl() at ??:?)(Native Method)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libunity.0x591b48 (SuiteIntersectionkUnitTestCategory::TestTransformedAABBSphere::RunImpl() const at ??:?)(Native Method)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libc.__pthread_start(void*)(__pthread_start:36)
09-28 11:16:27.353 10944 10944 E AndroidRuntime:        at libc.__start_thread(__start_thread:68)

Okay, I found the solution to the issue after trying many many unrelated fixes. I had previously thought the crash was occurring on all android devices, however the insta-crash was ONLY happening on my One Plus 7 Pro.

I don’t actually know why this fixed it, but after setting up the Unity Cloud Diagnostics dashboard, I started seeing the word “Vulkan” in the native stack trace that I was provided with in Crashes and Exceptions.

I also read somewhere that OnePlus 7 Pro doesn’t work well with OpenGL 3, but I can’t confirm this since I had already removed OpenGL 3 previously.

I CAN confirm that Vulkan was causing some issue.

I decided to just remove Vulkan from the supported Graphics APIs in Unity Player Settings > Other Settings, leaving only OpenGL 2 and now it finally works!