Ios ';NSInvalidArgumentException';,原因:'+;[FIRInstanceIDCheckinPreferences首选项来自KeyChain内容::';无法识别的选择器发送到类';

Ios ';NSInvalidArgumentException';,原因:'+;[FIRInstanceIDCheckinPreferences首选项来自KeyChain内容::';无法识别的选择器发送到类';,ios,swift,xcode,firebase,compiler-errors,Ios,Swift,Xcode,Firebase,Compiler Errors,当我尝试使用Firebase的MLModel解释器在我的Xcode项目中加载tflite文件时,在Launchsreen完全可见后,我遇到以下错误: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[FIRInstanceIDCheckinPreferences preferencesFromKeychainContents:]: unrecognized selector

当我尝试使用Firebase的MLModel解释器在我的Xcode项目中加载tflite文件时,在Launchsreen完全可见后,我遇到以下错误:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[FIRInstanceIDCheckinPreferences preferencesFromKeychainContents:]: unrecognized selector sent to class 0x10235ca58
我的代码基于Firebase的教程,因此我很惊讶它不起作用。代码如下:

import Firebase


    var interpreter: ModelInterpreter?

    func convertTheModel(){


        guard let modelPath = Bundle.main.path( forResource: "model", ofType: "tflite", inDirectory: ""
            )
            else {
                print("not able to load model")
                return

        }

        let localModel = CustomLocalModel(modelPath: modelPath)
        interpreter =  ModelInterpreter.modelInterpreter(localModel: localModel)

        let ioOptions = ModelInputOutputOptions()
        do {
            try ioOptions.setInputFormat(index: 0, type: .float32, dimensions: [1, 22])
            try ioOptions.setOutputFormat(index: 0, type: .float32, dimensions: [1, 1])
        } catch let error as NSError {
            print("Failed to set input or output format with error: \(error.localizedDescription)")
        }



    let inputs = ModelInputs()
    var inputData = Data()

        do {
            for _ in 0 ..< 22 {

              // require fixed-point values or the original bytes.
              var RandomNumber = Float.random(in: 0 ..< 1)

              // Append normalized values to Data object.
              let elementSize = MemoryLayout.size(ofValue: RandomNumber)
              var bytes = [UInt8](repeating: 0, count: elementSize)
              memcpy(&bytes, &RandomNumber, elementSize)
              inputData.append(&bytes, count: elementSize)
          }
          try inputs.addInput(inputData)
        } catch let error {
          print("Failed to add input: \(error)")
        }


        interpreter!.run(inputs: inputs, options: ioOptions) { outputs, error in
            guard error == nil, let outputs = outputs else { return }

            print(outputs)
        }

    }


以下是我所做工作的总结:

  • 我清理了建筑文件夹
  • 重新安装所有吊舱:
    吊舱去集成
    吊舱安装
  • 将“无公共块”设置为“无”
  • 按所述移除所有-ObjC
  • 我的播客文件是:

    platform :ios, '13.0'
    
    target 'My Project' do
      # Comment the next line if you don't want to use dynamic frameworks
      use_frameworks!
    
      # Pods for My Project
      pod 'Firebase/Database'
      pod 'Firebase/Auth'
      pod 'GoogleMobileVision/FaceDetector'
      pod 'Firebase/Firestore'
      pod 'Firebase/MLModelInterpreter'
    
    
    end
    
    
    
    如果有人能帮忙,我将不胜感激

    编辑

    如果有人有其他解决方案将tflite文件(或h5文件:查看我之前的问题)加载到Xcode项目中,这也会很有帮助

    @保罗贝乌斯特林

    这是我粘贴
    -ObjC
    的位置:

    -ObjC必须位于应用程序的
    其他链接器标志中
    ,Firebase才能正常工作。有关此问题的更多详细信息,请参阅

    首先,您是否理解
    无法识别的选择器
    异常的含义?首先,感谢您的即时响应。我不太了解它的细节,但我知道选择器是过去的遗物,来自Objective-C。它根据选择器选择要在对象上执行的函数。()这个信息如何帮助解决我的问题?选择器是方法的另一个名称。异常的意思是,您试图对没有该方法的对象调用方法。换句话说,您使用了错误的对象。可能是问题所在。@特洛伊木马程序谢谢,我会检查它的。我尝试过它,但运行的问题与问题中描述的相同:
    ld:46体系结构的重复符号arm64叮当声:错误:链接器命令失败,退出代码为1(使用-v查看调用)
    。可能是我在错误的
    其他链接器标志上添加了
    -ObjC
    。我粘贴在Podstarget文件上:(问题中的图片)对吗?应该是应用程序的项目设置,而不是Pods项目。如果您仍然遇到重复符号问题,请分享详细信息…我尝试过,但我面临的问题与问题中描述的相同。你知道怎么解决吗。既没有遇到构建错误,也没有遇到其他崩溃错误?我需要了解有关复制符号错误的更多详细信息
    platform :ios, '13.0'
    
    target 'My Project' do
      # Comment the next line if you don't want to use dynamic frameworks
      use_frameworks!
    
      # Pods for My Project
      pod 'Firebase/Database'
      pod 'Firebase/Auth'
      pod 'GoogleMobileVision/FaceDetector'
      pod 'Firebase/Firestore'
      pod 'Firebase/MLModelInterpreter'
    
    
    end