【问题标题】:Xcode is not detecting library..Cannot find Firebase 'FaceDetectorOptions' in scopeXcode 未检测库..在范围内找不到 Firebase 'FaceDetectorOptions'
【发布时间】:2021-09-16 08:44:05
【问题描述】:

我正在尝试在我的应用程序中使用 Firebase FaceDetector,但我不断收到错误 = "Cannot find 'FaceDetectorOptions' in scope",似乎 Xcode 无法检测到 FireBase "GoogleMLKit/FaceDetection" 库,即使我进行了干净构建文件夹我的应用程序,重新启动应用程序并更新我的 PodFile .....我仍然收到此错误

这是我的 Podfile

pod 'Firebase/Auth'
pod 'Firebase/Analytics'
pod 'GoogleSignIn'
pod 'Google-Mobile-Ads-SDK'
pod 'GoogleMLKit/TextRecognition'
pod 'GoogleMLKit/FaceDetection'

end

这是我的 Xcode 代码

  import Firebase

    override func viewDidLoad() {
    super.viewDidLoad()
     
     let options = FaceDetectorOptions()     //ERROR : Cannot find 'FaceDetectorOptions' in scope
    }

这是 google MLKIT 的链接: https://developers.google.com/ml-kit/vision/face-detection/ios

【问题讨论】:

    标签: ios swift xcode firebase firebase-mlkit


    【解决方案1】:

    添加

    import MLKit
    

    到文件顶部

    【讨论】:

    • 我怎么知道如果它没有包含在文档中或者你是怎么知道的
    • 经验,如果您查看您链接的站点顶部的面包屑,您将看到 MLKit。另外,在示例代码中。
    猜你喜欢
    • 2021-09-17
    • 2021-08-19
    • 2022-01-07
    • 2021-02-02
    • 1970-01-01
    • 2020-11-23
    • 2021-06-18
    • 2021-01-15
    • 1970-01-01
    相关资源
    最近更新 更多