1. First, make sure that the framework of Swift includes the simulator architecture. Xcode 12 has changed the default architecture of the simulator, and there are many solutions on the Internet, so I won't go into details here.
2. Create an empty swift static library project with Xcode, then add all Swift files in the original static library and edit a new static library, which can be solved.