Android game freezes first startup (infinite loop) on Prod build with armv7 and arm64

Been looking hard for similar problems but can’t find where the issues lies…

Using Unity 2021.3.0f1 / android.

Seems to happen when I select both armv7 and arm64.

What happens is that on production build, the first start will freeze the app. Killing and restarting the app fixes the issue and the issue never re-apears again.

I checked the logs and there seems to be an infinite loop since there are thousands of logs per seconds non-stop. Here is an excerpt of the logs, it doesn’t start/end here but this seems to be logged thousands of times.

I have absolutely no idea how to solve this! I’ve tried deleting the il2cpp folder as mentioned in other similar issues but that didn’t help:

2023-05-26 14:04:40.935  1977-2125  GameSDK@LifeCycle       system_server                        I  noteResumeComponent(): package name  : com.CompanyOfBros.PowerUp
2023-05-26 14:04:40.979  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: -1
2023-05-26 14:04:41.000 27727-27727 ViewRootIm...rActivity] com.CompanyOfBros.PowerUp            I  updateBoundsLayer: t = android.view.SurfaceControl$Transaction@2f489f8 sc = Surface(name=Bounds for - com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity@3)/@0x631b956 frame = 521
2023-05-26 14:04:41.008 27727-27727 ViewRootIm...rActivity] com.CompanyOfBros.PowerUp            I  Drawing: package:com.CompanyOfBros.PowerUp, metrics=DisplayMetrics{density=2.25, width=810, height=1626, scaledDensity=2.25, xdpi=307.0, ydpi=305.0}, compatibilityInfo={420dpi always-compat}
2023-05-26 14:04:41.046  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: 1
2023-05-26 14:04:41.050  1977-2125  GameSDK@LifeCycle       system_server                        I  noteResumeComponent(): package name  : com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.074 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.075 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.083 27727-27727 MSHandlerLifeCycle      com.CompanyOfBros.PowerUp            I  check: return. Multi-window not supported pkg=com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.113  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: -1
2023-05-26 14:04:41.167  1977-2125  GameSDK@LifeCycle       system_server                        I  noteResumeComponent(): package name  : com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.169  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: 1
2023-05-26 14:04:41.184 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.185 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.186 21380-21393 Finsky                  com.android.vending                  I  [2287] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.187 21380-21393 Finsky                  com.android.vending                  I  [2287] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.195 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.196 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.201 27727-27727 MSHandlerLifeCycle      com.CompanyOfBros.PowerUp            I  check: return. Multi-window not supported pkg=com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.258  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: -1
2023-05-26 14:04:41.264 27727-27727 ViewRootIm...rActivity] com.CompanyOfBros.PowerUp            I  updateBoundsLayer: t = android.view.SurfaceControl$Transaction@2f489f8 sc = Surface(name=Bounds for - com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity@3)/@0x631b956 frame = 522
2023-05-26 14:04:41.275 27727-27727 ViewRootIm...rActivity] com.CompanyOfBros.PowerUp            I  Drawing: package:com.CompanyOfBros.PowerUp, metrics=DisplayMetrics{density=2.25, width=810, height=1626, scaledDensity=2.25, xdpi=307.0, ydpi=305.0}, compatibilityInfo={420dpi always-compat}
2023-05-26 14:04:41.302  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: 1
2023-05-26 14:04:41.326  1977-2125  GameSDK@LifeCycle       system_server                        I  noteResumeComponent(): package name  : com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.327 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.329 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.333 27727-27727 MSHandlerLifeCycle      com.CompanyOfBros.PowerUp            I  check: return. Multi-window not supported pkg=com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.358  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: -1
2023-05-26 14:04:41.411 21380-21393 Finsky                  com.android.vending                  I  [2287] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.412 21380-21393 Finsky                  com.android.vending                  I  [2287] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.414  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: 1
2023-05-26 14:04:41.418 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.419 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.421  1977-2125  GameSDK@LifeCycle       system_server                        I  noteResumeComponent(): package name  : com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.449 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.454 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.456 27727-27727 MSHandlerLifeCycle      com.CompanyOfBros.PowerUp            I  check: return. Multi-window not supported pkg=com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.514  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: -1
2023-05-26 14:04:41.530 27727-27727 ViewRootIm...rActivity] com.CompanyOfBros.PowerUp            I  updateBoundsLayer: t = android.view.SurfaceControl$Transaction@2f489f8 sc = Surface(name=Bounds for - com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity@3)/@0x631b956 frame = 523
2023-05-26 14:04:41.533 27727-27727 ViewRootIm...rActivity] com.CompanyOfBros.PowerUp            I  Drawing: package:com.CompanyOfBros.PowerUp, metrics=DisplayMetrics{density=2.25, width=810, height=1626, scaledDensity=2.25, xdpi=307.0, ydpi=305.0}, compatibilityInfo={420dpi always-compat}
2023-05-26 14:04:41.570  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: 1
2023-05-26 14:04:41.584 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.585 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.591 27727-27727 MSHandlerLifeCycle      com.CompanyOfBros.PowerUp            I  check: return. Multi-window not supported pkg=com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.597  1977-2125  GameSDK@LifeCycle       system_server                        I  noteResumeComponent(): package name  : com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.615  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: -1
2023-05-26 14:04:41.659  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: 1
2023-05-26 14:04:41.671 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.672 21380-26162 Finsky                  com.android.vending                  I  [2440] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.674 21380-21393 Finsky                  com.android.vending                  I  [2287] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.675 21380-21393 Finsky                  com.android.vending                  I  [2287] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.687 21380-21393 Finsky                  com.android.vending                  I  [2287] khm.a(17): com.CompanyOfBros.PowerUp: Account determined from installer data - [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.688 21380-21393 Finsky                  com.android.vending                  I  [2287] khm.a(67): Billing preferred account via installer for com.CompanyOfBros.PowerUp: [qStri7AofiUhbkj25tuShStLb-vxfHVxOm3_6J0LR94]
2023-05-26 14:04:41.688 27727-27727 MSHandlerLifeCycle      com.CompanyOfBros.PowerUp            I  check: return. Multi-window not supported pkg=com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.699  1977-2125  GameSDK@LifeCycle       system_server                        I  noteResumeComponent(): package name  : com.CompanyOfBros.PowerUp
2023-05-26 14:04:41.749  1289-1289  SurfaceFlinger          surfaceflinger                       I  [f5fee70 com.CompanyOfBros.PowerUp/com.unity3d.player.UnityPlayerActivity#216894] FrameRatePriority: -1

@MastaMax - I’m sorry for the delay in response, we currently have a small number of active moderators and I’m trying my best to keep up.

Looking at your logs, it appears that there’s a repeated pattern related to the game life cycle and billing preferences, but it’s not directly indicative of what might be causing the freeze or the infinite loop.

Given the information you’ve provided, I can suggest the following debugging steps:

Step 1: Isolate your builds

Try building and testing for armv7 and arm64 separately. This might help determine whether the issue is exclusive to one architecture or if it occurs on both.

Step 2: Check your startup code

Examine the code that runs during the startup of your application. Look out for potential infinite loops, network calls that could hang, or any operation that could take a long time to complete.

Step 3: Deep dive into logs

It might be useful to create a more verbose logging for your application startup to help identify where exactly the freeze is happening.

Step 4: Test on different devices

Try to run the production build on different devices and Android versions. This might help to narrow down if the problem is device or OS specific.

I hope this helps, and feel free to post any additional questions or information. We appreciate your patience.