我不能再在模拟器上运行我的应用程序了。Online建议我编辑我的项目。Pbxproj,但这似乎不起作用。如何恢复在模拟器上运行项目的能力(并在设备上仍然能够这样做)?我正在开发另一个项目,该项目使用了许多相同的框架,但它运行在模拟器上。什么会导致类似的框架在一个项目中工作,而在另一个项目中不工作?
当前回答
可能的原因是
framework which you are using may not be built for simulator architecture(x86_64), you can check the compatibility by going to framework folder (framework_name.framework --> modules --->framework_name.swiiftModule-->) in this path you should see arm/i386/x86_64 support files if you have updated to new Xcode, the frameworks you are using are not compatible to the newer compiler version, so vendor needs to share the recent compatible one, in this case you will not be able to run on both device and simulator
其他回答
我想你所链接的框架只是为arm架构而构建的。你不能在模拟器中运行它。您将需要框架的作者来构建一个“通用框架”。
可能的原因是
framework which you are using may not be built for simulator architecture(x86_64), you can check the compatibility by going to framework folder (framework_name.framework --> modules --->framework_name.swiiftModule-->) in this path you should see arm/i386/x86_64 support files if you have updated to new Xcode, the frameworks you are using are not compatible to the newer compiler version, so vendor needs to share the recent compatible one, in this case you will not be able to run on both device and simulator
Xcode 12.3
在我的案例中,我通过在Build Settings选项卡中简单地将Validate Workspace设置为Yes来解决这个问题
使用.xcframework,而不是包含iOS和iOS模拟器切片的“胖”.framework。 这也避免了在为App Store构建时使用构建阶段剥离iOS模拟器切片的需要。
“Fat”框架通常是使用lipo创建的,因为它们不能直接由Xcode构建,因此不受支持(来源:开发者技术支持苹果开发者论坛). xcframework是唯一受支持的机制,可以发布一个支持iOS和iOS模拟器的单一框架。
此外,.xframework是唯一支持发布二进制Swift框架的方式(来源:苹果开发者论坛上的开发者技术支持)。
在Xcode 12.3中,不支持“胖”框架的事实是强制的,因为Xcode在构建过程中验证了框架,这就是为什么很多项目突然开始看到构建错误。
如果你是Xcode的新手,使用Xcode只是为了启动模拟器来运行appium工具,以上步骤可能会比较复杂。对于初学者来说,使用小于11的xcode版本即可。
此链接有助于下载xcode 10.3
Xcode10.3
如果你尝试从AppStore下载,我们需要有高达40gb的空闲存储空间,上述' xip文件将不会导致存储错误。
你可以稍后感谢我,如果这工作!!
推荐文章
- 如何删除默认的导航栏空间在SwiftUI导航视图
- Ios模拟器:如何关闭应用程序
- 准备好开发人员ID的macOS安装程序包
- 创建配置文件失败
- 如何在iOS中使用Swift编程segue
- Swift -整数转换为小时/分钟/秒
- Swift:声明一个空字典
- 在成功提交我的应用程序后,“太多符号文件”
- 首先添加一个UIView,甚至是导航栏
- 复制并重命名Xcode项目和相关文件夹
- 我如何改变UIButton标题颜色?
- 在Swift中如何调用GCD主线程上的参数方法?
- NSLayoutConstraints是可动画的吗?
- iOS -构建失败,CocoaPods无法找到头文件
- Xcode 4挂在“附加到(应用程序名称)”