Search Issue Tracker
By Design
Votes
0
Found in
2018.4
2019.4
2019.4.12f1
Issue ID
1317669
Regression
No
[macOS] Objective-C @available invoked from a bundle returns false on available macOS versions
Steps to reproduce:
1. Open the project attached by the user
2. Open "scene"
3. Enter Play mode
Expected result: @available from bundle returns true on all versions that are available
Actual result: @available from bundle returns false for 11.0 and 11.1 (tested on 11.1)
Reproducible with: 2018.4.32f1, 2019.4.22f1
Not reproducible with: 2020.3.0f1, 2021.1.0b11, 2021.2.0a8
Notes:
- Doesn't reproduce with 2019.4.22f1 when build is launched from Xcode project (Xcode 12.3 used)
- Likely related to being built with an older Xcode version
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (2021.2.X):
this is issue is coming from the way @available clauses are handled. Using it will result in code generated that does something like
if(__isPlatformVersionAtLeast(...)) {...}
where __isPlatformVersionAtLeast is *statically linked* function in the main app.
I reiterate, the check for current OS version is built into the app itself. And what happens, essentially, that SDK version you built with impacts the "known" OS version, so if you build with "old" SDK, than, say, 11.0 will become, say, 10.16 (the largest OS version known to SDK used to build the app.)
Sure enough, when you build macos player "normaly" you get app bundle that unity have built, and sure enough this cannot be the "latest available sdk".
Well, not exactly "cannot": for example if i run your project on the latest development unity version it works fine (because we have updated the toolchaion internally to newer xcode).
But not all is lost! You can build your project with "Create Xcode Project" checked in build window, which will generate xcode project that you can build with newest xcode, and then everything will just work