找不到目标'x86_64-apple-ios-simulator'的模块 [英] Could not find module for target 'x86_64-apple-ios-simulator'
问题描述
我有我的自定义框架,并且可以在XCode 10中正常工作.我在XCode 11 beta 3中对其进行了重建,然后将其集成到应用程序中,并出现以下错误:
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:
找不到目标"x86_64-apple-ios-simulator"的模块"MyCustomFramework";找到:arm64,arm64-apple-ios
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.
推荐答案
为解决此问题,我不得不使用xcode 11工具再次创建一个自定义框架的胖库.
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)为iOS模拟器构建YourCustomFramework
目标,并从桌面上的products文件夹中提取框架.
1) Build YourCustomFramework
target for iOS simulator and extract framework from products folder on your desktop.
Xcode▸派生数据▸您的项目▸构建▸产品▸Release-iphonesimulator
2)为通用iOS设备构建YourCustomFramework
目标,并从桌面上的products文件夹中提取框架.
2) Build YourCustomFramework
target for Generic iOS Device and extract framework from products folder on your desktop.
Xcode▸派生数据▸您的项目▸构建▸产品▸发布iphoneos
3),将模拟器生成的框架重命名为YourCustomFramework-sim.framework
,以便以后可以区分.
3) Rename the simulator generated framework to YourCustomFramework-sim.framework
so that it is distinguishable later.
4)使用lipo命令将两个二进制文件合并为一个胖二进制文件. (cd到您的桌面或自定义框架文件所在的位置)
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)复制在上一步中创建的YourCustomFramework
二进制文件,并将其替换为YourCustomFramework.framework
文件夹中的二进制文件.
5) Copy YourCustomFramework
binary file created in above step and replace it with the binary in YourCustomFramework.framework
folder.
6)从文件夹
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.
这篇关于找不到目标'x86_64-apple-ios-simulator'的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!