Hello,
We upgraded our project to UE 5.1 (Github source, 5.1 branch) from 5.0.3 and after fixing all the compilation and blueprint errors, the project runs properly in the editor. However, when packaging for iOS, we’re running into cook issues (shader compilation?):
We’re getting tons of:
UATHelper: Packaging (IOS): LogShaderCompilers: Warning: Failed to compile Material /Game/Art/VFX/GoBigDispenser/MM_TokenTest.MM_TokenTest (MI:/Game/Art/VFX/GoBigDispenser/MI_SilverLike.MI_SilverLike) for platform SF_METAL, Default Material will be used in game.
UATHelper: Packaging (IOS): /var/folders/nz/fjdvbmbs6h38d0yjvts4jm00p94d00/T/MetalShaderCompilation/25472/9719_152382656.metal(0): Failed to package /var/folders/nz/fjdvbmbs6h38d0yjvts4jm00p94d00/T/MetalShaderCompilation/25472/9719_152382656.air into /var/folders/nz/fjdvbmbs6h38d0yjvts4jm00p94d00/T/MetalShaderCompilation/25472/9719_152382656.metallib, code: 1, output: metal: warning: using sysroot for 'iPhoneOS' but targeting 'MacOSX' [-Wincompatible-sysroot]
UATHelper: Packaging (IOS): LLVM ERROR: Error opening '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/ios/bin/../lib/clang/31001.517/lib/darwin/libmetal_rt_osx.a': No such file or directory!
Our project built on iOS and ran properly in UE 4.26.2 and 5.0.3 (albeit, requiring some tweaking for compatibility). However, going from 5.0.3 to 5.1.0, we are seeing this issue.
We are currently using Xcode 13.4.1 on OSX 12.6 (same environment when builds were working for UE 5.0.3), and I’ve verified that /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/ios/bin/../lib/clang/31001.517/lib/darwin/libmetal_rt_osx.a
doesn’t exist. However, there is a /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/metal/ios/bin/../lib/clang/31001.517/lib/darwin/libmetal_rt_ios.a
, so the shader compiler or something in the build toolchain may be selecting the wrong metal library?
I tried something silly like make a copy of libmetal_rt_ios.a
and named it libmetal_rt_osx.a
, but that doesn’t seem right - however, in doing so, the shaders do compile properly and that particular error disappears.
Any insight would be appreciated. Thanks!