m1 pro build iOS app runtime error: COLLADA files are not supported on this platform

m1 pro build iOS app runtime error: COLLADA files are not supported on this platform

m1pro 芯片(我的新 MacBook Pro 14')中,iOS App 加载 dae 文件错误。在模拟器和设备中崩溃。

    func makeUIView(context: Context) -> UIView {
        let scene = SCNScene(named: "art.scnassets/3dmodel.dae")!   //crash here, error "COLLADA files are not supported on this platform."
        ...other code...
    }

但相同的代码适用于 intel 芯片(MacBook Pro 13' 2017)内置 iOS APP

问题:苹果m1pro芯片不支持dae文件吗?但是c4d在m1pro中运行良好

环境:

尝试过:

以上都不行。

已解决。通过这样做

sudo xcode-select --reset

因为我在构建时发现了警告。 build warnings

注意 xcode 实际上在构建时将 dae 文件转换为 scn 文件,但警告说转换失败。 然后我尝试 运行 xc运行 scntool,它出错了。

xcrun scntool
scntool: warning: Could not find bundle inside /Library/Developer/CommandLineTools
 at path /Library/Developer/SharedFrameworks/ModelIO.framework
scntool: warning: Could not find bundle inside /Library/Developer/CommandLineTools
 at path /Library/Developer/SharedFrameworks/SceneKit.framework
scntool: warning: Could not find bundle inside /Library/Developer/CommandLineTools
 at path /Library/Developer/SharedFrameworks/PhysicsKit.framework
scntool: warning: Could not find bundle inside /Library/Developer/CommandLineTools
 at path /Library/Developer/SharedFrameworks/Jet.framework
scntool: warning: Could not find bundle inside /Library/Developer/CommandLineTools
 at path /Library/Developer/SharedFrameworks/SpriteKit.framework
usage: scntool --convert file --format format [--output file]
scntool: error: (null)

ComandLineTool 出了点问题,所以我按照这个 post 执行了这些步骤。

有效。构建没有 scntool 警告的应用程序,并且该应用程序 运行 运行良好。