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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
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