This exception is happening only trying to play some specific timeline assets in mobile builds (Android Mono and IL2CPP and iOS).
Managed Stack Trace:
UnityEngine.Timeline.TimelinePlayable.CreateTrackOutput (UnityEngine.Playables.PlayableGraph graph, UnityEngine.Timeline.TrackAsset track, UnityEngine.GameObject go, UnityEngine.Playables.Playable playable, System.Int32 port) (at /Users/usr/Project/Library/PackageCache/com.unity.timeline@1.4.8/Runtime/TimelinePlayable.cs:165)
UnityEngine.Timeline.TimelinePlayable.CreateTrackPlayable (UnityEngine.Playables.PlayableGraph graph, UnityEngine.Playables.Playable timelinePlayable, UnityEngine.Timeline.TrackAsset track, UnityEngine.GameObject go, System.Boolean createOutputs) (at /Users/usr/Project/Library/PackageCache/com.unity.timeline@1.4.8/Runtime/TimelinePlayable.cs:227)
UnityEngine.Timeline.TimelinePlayable.CompileTrackList (UnityEngine.Playables.PlayableGraph graph, UnityEngine.Playables.Playable timelinePlayable, System.Collections.Generic.IEnumerable`1[T] tracks, UnityEngine.GameObject go, System.Boolean createOutputs) (at /Users/usr/Project/Library/PackageCache/com.unity.timeline@1.4.8/Runtime/TimelinePlayable.cs:134)
UnityEngine.Timeline.TimelinePlayable.Compile (UnityEngine.Playables.PlayableGraph graph, UnityEngine.Playables.Playable timelinePlayable, System.Collections.Generic.IEnumerable`1[T] tracks, UnityEngine.GameObject go, System.Boolean autoRebalance, System.Boolean createOutputs) (at /Users/usr/Project/Library/PackageCache/com.unity.timeline@1.4.8/Runtime/TimelinePlayable.cs:114)
UnityEngine.Timeline.TimelinePlayable.Create (UnityEngine.Playables.PlayableGraph graph, System.Collections.Generic.IEnumerable`1[T] tracks, UnityEngine.GameObject go, System.Boolean autoRebalance, System.Boolean createOutputs) (at /Users/usr/Project/Library/PackageCache/com.unity.timeline@1.4.8/Runtime/TimelinePlayable.cs:85)
UnityEngine.Timeline.TimelineAsset.CreatePlayable (UnityEngine.Playables.PlayableGraph graph, UnityEngine.GameObject go) (at /Users/usr/Project/Library/PackageCache/com.unity.timeline@1.4.8/Runtime/TimelineAsset.cs:371)
UnityEngine.Playables.PlayableAsset.Internal_CreatePlayable (UnityEngine.Playables.PlayableAsset asset, UnityEngine.Playables.PlayableGraph graph, UnityEngine.GameObject go, System.IntPtr ptr) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Director/PlayableAsset.cs:41)
UnityEngine.Playables.PlayableDirector:Play()
<StartPlayableDirectorAnimation>d__16:MoveNext() (at /Users/usr/Project/Assets/_Game/CoreMVC/Views/Map/CutsceneView.cs:54)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr) (at /Users/bokken/buildslave/unity/build/Runtime/Export/Scripting/Coroutines.cs:17)
I’ve already tried including the Timeline and Playable classes in link.xml:
<assembly fullname="Unity.Timeline" preserve="all"/>
<assembly fullname="UnityEngine">
<namespace fullname="UnityEngine.Playables" preserve="all"/>
</assembly>
But it still happens, even with Mono and code stripping disabled, so it doesn’t sem to be related to stripping, and it works perfectly in Unity Editor.
The PlayableDirectors are already instantiated in the scene and we’re not using Addressables or AssetBundles for loading it.
Using Unity 2020.3.11