for me the solution was to set the Project Format to Xcode 16.0 for my main target in xcode. It was set to Xcode 9.5 before and was giving this exact error.