Skip to content

Intermittent splash screen hang on Android #286

@adamsoutar

Description

@adamsoutar

Environment

How do you use Sentry?
Sentry SaaS (sentry.io)

Which SDK and version?
Sentry Unity 0.4.3 (https://github.com/getsentry/unity.git#0.4.3 via UPM)

Steps to Reproduce

  1. Add Sentry to the project and enter the DSN
  2. Build an Android APK
  3. Run the Android app

Result

When running the built Android app, sometimes it will work, but roughly 1 in 10 starts of the app will hang indefinitely on the splash screen. This was a baffling issue, and it is resolved by removing sentry-unity from the project.

Looking at adb logcat for one of the hangs, it seems to print this:

08-20 17:17:07.104 27021 27036 I zygote  : Rejecting re-init on previously-failed class java.lang.Class<com.unity3d.player.AssetPackManagerWrapper$b>: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/play/core/assetpacks/AssetPackStateUpdateListener;
08-20 17:17:07.104 27021 27036 I zygote  :   at boolean com.unity3d.player.UnityPlayer.nativeRender() ((null):-2)
08-20 17:17:07.104 27021 27036 I zygote  :   at boolean com.unity3d.player.UnityPlayer.access$300(com.unity3d.player.UnityPlayer) ((null):-1)
08-20 17:17:07.104 27021 27036 I zygote  :   at boolean com.unity3d.player.UnityPlayer$e$1.handleMessage(android.os.Message) ((null):-1)
08-20 17:17:07.104 27021 27036 I zygote  :   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
08-20 17:17:07.104 27021 27036 I zygote  :   at void android.os.Looper.loop() (Looper.java:164)
08-20 17:17:07.104 27021 27036 I zygote  :   at void com.unity3d.player.UnityPlayer$e.run() ((null):-1)
08-20 17:17:07.104 27021 27036 I zygote  : Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.play.core.assetpacks.AssetPackStateUpdateListener" on path: DexPathList[[zip file "/data/app/me.overflo.mygame-Jtekv7VX5bBOly1L6sqzfA==/base.apk"],nativeLibraryDirectories=[/data/app/me.overflo.mygame-Jtekv7VX5bBOly1L6sqzfA==/lib/arm, /data/app/me.overflo.mygame-Jtekv7VX5bBOly1L6sqzfA==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
08-20 17:17:07.104 27021 27036 I zygote  :   at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
08-20 17:17:07.104 27021 27036 I zygote  :   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
08-20 17:17:07.104 27021 27036 I zygote  :   at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
08-20 17:17:07.104 27021 27036 I zygote  :   at boolean com.unity3d.player.UnityPlayer.nativeRender() ((null):-2)
08-20 17:17:07.104 27021 27036 I zygote  :   at boolean com.unity3d.player.UnityPlayer.access$300(com.unity3d.player.UnityPlayer) ((null):-1)
08-20 17:17:07.104 27021 27036 I zygote  :   at boolean com.unity3d.player.UnityPlayer$e$1.handleMessage(android.os.Message) ((null):-1)
08-20 17:17:07.104 27021 27036 I zygote  :   at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:102)
08-20 17:17:07.104 27021 27036 I zygote  :   at void android.os.Looper.loop() (Looper.java:164)
08-20 17:17:07.104 27021 27036 I zygote  :   at void com.unity3d.player.UnityPlayer$e.run() ((null):-1)

I wasn't able to make much sense of that, but it does seem to only be printed on the launches that hang. No logs are printed from my C# code on these launches, implying that it hasn't started to properly load the game yet.

The issue is not reproducible on iOS or PC. There isn't a consistent gap between launches that hang - sometimes they're only 1 or 2 apart, sometimes you can go for 10 or more without seeing anything go wrong. I had to sit and open and close the app over and over haha

Potentially useful info

Unity version - 2021.1.17f1
Scripting Backend - IL2CPP
API Compatibility Level - .NET Standard 2.0
C++ Compiler Configuration - Master

Please do let me know if there's any other info that would be helpful for debugging this issue - I'd love to be able to use Sentry in my project.
I might come back and attach a reproducible example project if I have the time this weekend.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions