Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Custom PlayableAssets play in editor, but cause error in iOS build

Discussion in 'Timeline' started by ilyapetrov_com, Nov 19, 2020.

  1. ilyapetrov_com

    ilyapetrov_com

    Joined:
    Jun 2, 2020
    Posts:
    5
    There is an unexpected error in my game. I was able to break down it and set a a simple experiment.

    [Create regular setup with Director and Timeline]
    1. New project, empty scene
    2. New Empty GameObject with Playable Director attached
    3. Empty timeline that applied to the director

    [Create customs playable track]
    4. Create Playable track (I've tried both via Timeline interface or script)
    5. Create PlayableAssets and connected PlayableBehaviour (I've tried both via Editor interface or script)
    6. No special actions inside, just Debug.Log in GraphStart and PrepareFrame.

    [Export everything to iOS]
    7. Export in debug mode, no special conditions
    8. Open in Xcode, change profiles for iPhone build
    9. Run on iPhone (7plus, latest iOS)

    Result log:
    The referenced script (Unknown) on this Behaviour is missing!
    (Filename: ./Runtime/Scripting/ManagedReference/SerializableManagedRef.cpp Line: 198)

    The referenced script on this Behaviour (Game Object '<null>') is missing!
    (Filename: ./Runtime/Mono/ManagedMonoBehaviourRef.cpp Line: 334)

    The referenced script (Unknown) on this Behaviour is missing!
    (Filename: ./Runtime/Scripting/ManagedReference/SerializableManagedRef.cpp Line: 198)

    The referenced script on this Behaviour (Game Object '<null>') is missing!
    (Filename: ./Runtime/Mono/ManagedMonoBehaviourRef.cpp Line: 334)


    Previous errors from the full game also included logs like the following:

    The referenced script (Unknown) on this Behaviour is missing!
    (Filename: ./Runtime/Scripting/ManagedReference/SerializableManagedRef.cpp Line: 198)

    The referenced script on this Behaviour (Game Object '<null>') is missing!
    (Filename: ./Runtime/Mono/ManagedMonoBehaviourRef.cpp Line: 334)

    A scripted object (probably LightControlTrack?) has a different serialization layout when loading. (Read 52 bytes but expected 740 bytes)
    Did you #ifdef UNITY_EDITOR a section of your serialized properties in any of your scripts?
    (Filename: ./Runtime/Serialize/SerializedFile.cpp Line: 2375)


    My guess (super noob here): it feels like this could be connected to serialisation of editor-related script which result in the absence of PlayableBehaviour in the build. Not sure how to test this. Reading about this for a week and don't know how to resolve it.

    Any ideas are welcome. Please, help. :)
     
  2. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    ilyapetrov_com likes this.
  3. ilyapetrov_com

    ilyapetrov_com

    Joined:
    Jun 2, 2020
    Posts:
    5
    Thanks a lot! I've tried this (created link.xml with both Timeline and Playable preserved), but it doesn't change anything for me. My Timeline is working. I could add activation track or setup a signal emitter. The only trouble is with custom Playable Track and Clips/Behaviours on it.
     
  4. seant_unity

    seant_unity

    Unity Technologies

    Joined:
    Aug 25, 2015
    Posts:
    1,516
    Okay, I wouldn't expect the custom track and behaviours to get stripped since they are part of the main assembly, but that's what appears to be happening.

    Here's some completely random guesses as to why that might be happening
    • The scripts are somewhere inside a folder named Editor (which means they are editor only and not included in the build)
    • The filename of the custom track and/or clip playable asset are not the same as the class (this usually causes issues in the editor as well)
    • A misplaced UNITY_EDITOR define? This might be likely based on this.
     
    ilyapetrov_com likes this.
  5. ilyapetrov_com

    ilyapetrov_com

    Joined:
    Jun 2, 2020
    Posts:
    5
    Oh, my! :) Thank you very much! It was the first one, with the Editor folder. My structural mind has set customs in seperate Editor folder even for the blank test project.

    How could I change the thread to [RESOLVED]? :)
     
    seant_unity likes this.
  6. dudleyhk

    dudleyhk

    Joined:
    Sep 27, 2017
    Posts:
    14
    Hi, I was wondering if you could help me with a similar issue. The Timeline/ Custom Assets are working in the Editor (other than the track's Cannot be Loaded which happens occasionally until I fiddle around and they come back). When I build the project it seems only the some of the audio tracks of the Timeline are playing and nothing else. Some of the notes you made I found and corrected but still no luck. Any other suggestions?? Thanks.