Firebase 不在 M1 模拟器上构建(在范围内找不到 'Analytics')
Firebase doesn't build on M1 simulator (Cannot find 'Analytics' in scope)
自从我切换到 M1 后,运行 模拟器上的应用程序被证明是不可能的。在设备本身上它工作正常。
我收到构建错误:Cannot find 'Analytics' in scope
import Firebase
class AlertService: AlertServiceBase, AlertServiceProtocol {
func showWarningAlert(dict: NSDictionary) {
...
Analytics.logEvent("blocked_no_more_warning", parameters: nil)
}
}
我和一位 Apple 工程师谈过,他说要将所有 Pods 架构更改为 Standard Architectures (arm64, armv7) - $(ARCHS_STANDARD)
。
它有助于进一步取得进展,但随后在 firebase 分析问题上失败了。他在 SO 上向 post 提出了这个问题。希望以前有人有过这个。谢谢
运行 pod update
更新到更新的 Firebase 版本。 Firebase 大约从 7.7.0 版本开始全面支持 M1 模拟器。
转到项目(非目标)
- 构建设置
- 排除的架构
- 调试-
添加一个名为
的新设置
Any iOS Simulator SDK - arm64
如果您正在使用 Pods,您也应该为您的 Pods 项目重复以上步骤。
一些 pod 目标(如您的 pod KeychainAccess)可能不遵守您在 Pods PROJECT 级别设置的内容,您可能也想修复这个完全相同的问题以冒犯 Pod 目标。
或者不是一一检查所有 pod 目标,您可以将其添加到 podfile 的末尾 -
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
完成此操作后,进行 pod install
和干净的构建,您应该可以开始了。
我只有在物理设备上调试时才会遇到这个问题,模拟器工作正常。
除了import Firebase
,我还得import FirebaseAnalytics
自从我切换到 M1 后,运行 模拟器上的应用程序被证明是不可能的。在设备本身上它工作正常。
我收到构建错误:Cannot find 'Analytics' in scope
import Firebase
class AlertService: AlertServiceBase, AlertServiceProtocol {
func showWarningAlert(dict: NSDictionary) {
...
Analytics.logEvent("blocked_no_more_warning", parameters: nil)
}
}
我和一位 Apple 工程师谈过,他说要将所有 Pods 架构更改为 Standard Architectures (arm64, armv7) - $(ARCHS_STANDARD)
。
它有助于进一步取得进展,但随后在 firebase 分析问题上失败了。他在 SO 上向 post 提出了这个问题。希望以前有人有过这个。谢谢
运行 pod update
更新到更新的 Firebase 版本。 Firebase 大约从 7.7.0 版本开始全面支持 M1 模拟器。
转到项目(非目标)
- 构建设置
- 排除的架构
- 调试-
添加一个名为
的新设置Any iOS Simulator SDK - arm64
如果您正在使用 Pods,您也应该为您的 Pods 项目重复以上步骤。
一些 pod 目标(如您的 pod KeychainAccess)可能不遵守您在 Pods PROJECT 级别设置的内容,您可能也想修复这个完全相同的问题以冒犯 Pod 目标。
或者不是一一检查所有 pod 目标,您可以将其添加到 podfile 的末尾 -
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
end
完成此操作后,进行 pod install
和干净的构建,您应该可以开始了。
我只有在物理设备上调试时才会遇到这个问题,模拟器工作正常。
除了import Firebase
,我还得import FirebaseAnalytics