[英]Realm app compiles on device but not on simulator on Xcode 12
我有一個Realm
應用程序,它在設備和模擬器的Xcode 11
中都運行良好。 我最近更新到Xcode 12
,現在該應用程序無法在任何模擬器中編譯,但在物理設備上運行良好。 經過研究,我注意到Realm
建議在您的Podfile
添加一些構建設置以排除arm64
,所以我去添加了它,但我仍然遇到錯誤。
這是我所做的更詳細的工作。
原始 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
這是我一步一步做的。
我將我的 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
在終端中,我輸入了pod install
。
重新編譯我的項目,它擺脫了第一個錯誤,但現在顯示以下錯誤。
知道現在可能出了什么問題嗎?
在我的情況下,將Realm
升級到最新版本10.1.0
並將cocoapods
更新到1.10.0
解決了該問題,我現在可以在模擬器上進行編譯。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.