Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

swift - Could not find module for target 'x86_64-apple-ios-simulator'

I have my custom framework and it works properly in XCode 10. I rebuild it in XCode 11 beta 3, then integrated into the app, and get the following error:

Could not find module 'MyCustomFramework' for target 'x86_64-apple-ios-simulator'; found: arm64, arm64-apple-ios

Are there some changes I have to make in "valid architectures" in the framework project?

Updated: I can't pick any answer as a correct one as the framework in my case was really tiny (one class, a few methods) and almost not in use, so I decided to get rid of it and move these a few methods into main project.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

To solve this issue I had to create a fat library of my custom framework again using xcode 11 tools.

To do that I did the following:

1) Build YourCustomFramework target for iOS simulator and extract framework from products folder on your desktop.

Xcode? ? ?DerivedData? ? ?Your Project ? ?Build? ? ?Products? ? ?Release-iphonesimulator

2) Build YourCustomFramework target for Generic iOS Device and extract framework from products folder on your desktop.

Xcode? ? ?DerivedData? ? ?Your Project ? ?Build? ? ?Products? ? ?Release-iphoneos?

3) Rename the simulator generated framework to YourCustomFramework-sim.framework so that it is distinguishable later.

4) Use the lipo command to combine both binaries into a single fat binary file. (cd to your desktop or wherever your custom framework file is located)

$lipo -create ./YourCustomFramework-sim.framework/YourCustomFramework ./YourCustomFramework.framework/YourCustomFramework -output ./YourCustomFramework

5) Copy YourCustomFramework binary file created in above step and replace it with the binary in YourCustomFramework.framework folder.

6) From folder

YourCustomFramework-sim.framework/Modules/YourCustomFramework.swiftmodule/

copy all of the modules and paste them to

YourCustomFramework.framework/Modules/YourCustomFramework.swiftmodule/

This should solve your issue.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...