“activityStartTrigger: not whiteListed” on android builds

I’m trying to build an android game with Unity 2019.2, using IL2CPP background and Android App Bundle format.

Whenever I try to launch the game, it crashes right after the Unity splash screen.

It actually crashes when loading a scene asynchronously, I have a first scene for loading purpose, so when the game starts, this first scene opens up and load the actual game scenes in background.
I don’t know if this has anything to do with my problem, but I’m using Google Play Services 0.9.64 (which is the latest right now).

I can really list everything I tried, because I had this problem for quite some time.

  • Right now I’m using Unity 2019.2.0f1, but the first time I had this problem was with 2019.1.10f1 and I tried with many versions, nothing seems to work there.
  • I checked if there was any problem with the AndroidManifest file but I don’t see anything wrong.
  • I tried to remove the OpenGLES3 option from Player Settings > Other > Graphics APIs (it seems to be a problem for some people).
  • [EDIT] I tried to add permissions lines in the Android Manifest file for Internet Access (and did the same thing for this options in Unity’s Player Settings).

If that might help, here’s what my Android Manifest looks like:

<?xml version="1.0" encoding="utf-8"?>
<!-- This file was automatically generated by the Google Play Games plugin for Unity
     Do not edit. -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="14" />     

        <!-- The space in these forces it to be interpreted as a string vs. int -->
        <meta-data android:name="com.google.android.gms.games.APP_ID"
            android:value="\u003████████████" />

        <!-- Keep track of which plugin is being used -->
        <meta-data android:name="com.google.android.gms.games.unityVersion"
            android:value="\u0030.9.64" />

        <activity android:name="com.google.games.bridge.NativeBridgeActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />

(I prefer to hide the APP_ID value, in case that might cause security issue)

And here’s the LogCat errors:

E/ActivityTrigger(2337): activityStartTrigger: not whiteListed  com.████████████.████████████/com.unity3d.player.UnityPlayerActivity/41
E/ActivityTrigger(2337): activityResumeTrigger: not whiteListed com.████████████.████████████/com.unity3d.player.UnityPlayerActivity/41
E/ActivityTrigger(2337): activityResumeTrigger: not whiteListed com.████████████.████████████/com.unity3d.player.UnityPlayerActivity/41
E/InputDispatcher(2337): channel '3ea1bfc com.████████████.████████████/com.unity3d.player.UnityPlayerActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

I don’t know what that means and I did quite a lot of research about the “activityStartTrigger: not whiteListed” thing, but can’t seem to find anything online.
Also I’m not doing anything in my code with UnityPlayerActivity.

It would be amazing if anyone could help me, I’m stuck on this problem and it prevent me from releasing my game.
Thanks a lot for your attention.

Ok so…

After A LOT of troubleshooting, I finally found the reason of these crashes, and how to fix them.

The logs I attached to the main message are actually incomplete.
I got these from Android Device Monitor’s logcat, with the filter “Unity”, but there’s many more Unity related logs that weren’t showing.

The activityStartTrigger thing is actually there on most of my builds, and is not responsible for any crashes.
The interesting one was about memory leaks:

Could not allocate memory: System out of memory!

So now, to know where that things was happening, I went back to previous git commits, to find from where the builds were crashing.

Long story short:
I had several serialized variables that I were using in the Editor only (I do a lot of Editor scripting), and since I didn’t need these variable in my builds, I wrapped them in #if UNITY_EDITOR #endif instructions.
But they were still serialized, so the serialize model of my objects wasn’t the same as the actual objects inside my builds.
I guess this got the memory all messy and eventually crashed my game.

So in the end, I gotta serialize all these variables, even though I’m not using them. This isn’t so much data that my games will become slow or whatever, but its kinda annoying, so I’ll probably find some workaround for these unused variables.

I hope this feedback can help anyone.