Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Undefined symbols from UnityFixedOrientationViewController 2021.3.29f1

Discussion in 'iOS and tvOS' started by Alanyeats, Aug 24, 2023.

  1. Alanyeats

    Alanyeats

    Joined:
    Feb 20, 2016
    Posts:
    22
    We have just upgraded to the latest LTS from 2021.3.22f1 to 2021.3.29f1 we are now getting
    Undefined symbols errors from within Unity Orientation code, which is not present on 2021.3.22. I have spent quite a bit of time digging into this and seenig if its just something obvious such as a missing trampoline lib but can't seem to find anything.

    Code (CSharp):
    1. Undefined symbols for architecture arm64:
    2.   "_OBJC_CLASS_$_UnityFixedOrientationViewController", referenced from:
    3.       _OBJC_CLASS_$_UnityPortraitOnlyViewController in UnityViewControllerBase+iOS.o
    4.       _OBJC_CLASS_$_UnityPortraitUpsideDownOnlyViewController in UnityViewControllerBase+iOS.o
    5.       _OBJC_CLASS_$_UnityLandscapeLeftOnlyViewController in UnityViewControllerBase+iOS.o
    6.       _OBJC_CLASS_$_UnityLandscapeRightOnlyViewController in UnityViewControllerBase+iOS.o
    7.   "_OBJC_METACLASS_$_UnityFixedOrientationViewController", referenced from:
    8.       _OBJC_METACLASS_$_UnityPortraitOnlyViewController in UnityViewControllerBase+iOS.o
    9.       _OBJC_METACLASS_$_UnityPortraitUpsideDownOnlyViewController in UnityViewControllerBase+iOS.o
    10.       _OBJC_METACLASS_$_UnityLandscapeLeftOnlyViewController in UnityViewControllerBase+iOS.o
    11.       _OBJC_METACLASS_$_UnityLandscapeRightOnlyViewController in UnityViewControllerBase+iOS.o
    12. ld: symbol(s) not found for architecture arm64
     
  2. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    did you try cleaning build? (Product -> Clean Build Folder) Also check if Classes/UI/UnityViewControllerBase+iOS.h contains UnityFixedOrientationViewController (and mm file too) - it might be that you might need to replace on build (though it should happen automatically since you updated unity version) or maybe you have those in you project (so it doesnt use unity builtin ones) or maybe even some build postprocess going wrong
     
  3. Alanyeats

    Alanyeats

    Joined:
    Feb 20, 2016
    Posts:
    22
    Hey,

    Yeah that seems to be it. UnityFixedOrientationViewController is defined within the H file but not the mm. After clean builds still same issue. Looking at a diff between the old version and new verison the mm are the h files have this diff upload_2023-8-24_14-41-4.png

    Left is 29 and right is 22. Any idea what the best course of action is? I don't have a custom version of the file at all either.

    If i just dump the 22 versions of the h file into 29 it compiles but get runtime errors.
     
    Last edited: Aug 24, 2023
  4. Alanyeats

    Alanyeats

    Joined:
    Feb 20, 2016
    Posts:
    22
  5. Alexey

    Alexey

    Unity Technologies

    Joined:
    May 10, 2010
    Posts:
    1,602
    > we were doing post build steps and manually editing the file to fix this bug
    ahaha, well, yeah - just update your steps for the new version. On the other hand - the bug in there should have been fixed long ago so you dont need to do anything extra
     
    Alanyeats likes this.
  6. Alanyeats

    Alanyeats

    Joined:
    Feb 20, 2016
    Posts:
    22
    Yeah, Manged to confirm it was fixed without that change so all good to just remove the fix. Thanks :D