[英]Realm app compiles on device but not on simulator on Xcode 12
I have a Realm
app that was running fine in Xcode 11
in both, the device and the Simulator.我有一个
Realm
应用程序,它在设备和模拟器的Xcode 11
中都运行良好。 I recently updated to Xcode 12
and now the app doesn't compile in any of the Simulators but works fine on physical devices.我最近更新到
Xcode 12
,现在该应用程序无法在任何模拟器中编译,但在物理设备上运行良好。 After researching I noticed that Realm
suggests adding some build settings in your Podfile
to exclude the arm64
, so I went and added it but I'm still getting errors.经过研究,我注意到
Realm
建议在您的Podfile
添加一些构建设置以排除arm64
,所以我去添加了它,但我仍然遇到错误。
Here is what I have done in more detail.这是我所做的更详细的工作。
Original Podfile looked like this :原始 Podfile 如下所示:
def shared_pods
pod 'RealmSwift', '~> 3.18'
end
target 'MyApp' do
use_frameworks!
platform :ios, '10.0'
shared_pods
target 'MyAppTests' do
inherit! :search_paths
end
target 'MyAppUITests' do
inherit! :search_paths
end
end
target 'MyApp Watch App' do
use_frameworks!
platform :watchos, '3.1'
# Pods for MyApp Watch App
shared_pods
end
target 'MyApp Watch App Extension' do
use_frameworks!
platform :watchos, '3.1'
shared_pods
end
Here is what I did step by step.这是我一步一步做的。
I modified my PodFile to what Realm recommends adding the following code at the end of the Podfile.我将我的 PodFile 修改为Realm建议在 Podfile 末尾添加以下代码。
post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64' config.build_settings['EXCLUDED_ARCHS[sdk=watchsimulator*]'] = 'arm64' config.build_settings['EXCLUDED_ARCHS[sdk=appletvsimulator*]'] = 'arm64' end end end
In the terminal I entered pod install
.在终端中,我输入了
pod install
。
Recompiled my project and it got rid of the first error but it now shows the following error.重新编译我的项目,它摆脱了第一个错误,但现在显示以下错误。
Any idea what could be wrong now?知道现在可能出了什么问题吗?
在我的情况下,将Realm
升级到最新版本10.1.0
并将cocoapods
更新到1.10.0
解决了该问题,我现在可以在模拟器上进行编译。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.