相关疑难解决方法(0)

Swift 5.1 错误:[plugin] AddInstanceForFactory:没有为 id <CFUUID 注册工厂

应用程序崩溃并显示以下错误消息

2019-10-12 20:01:34.332334-0700 Awesome App[26368:3535170] [plugin] AddInstanceForFactory: No factory registered for id <CFUUID 0x600002903280> F8BB1C28-BAE8-11D6-9C31-00039315CD46
Run Code Online (Sandbox Code Playgroud)

崩溃时的断点似乎与 AVAudioPlayer 有关

let path = Bundle.main.path(forResource: "menu_background.mp3", ofType:nil)!
audioPlayer = try AwesomeAudioPlayer(contentsOf: URL(fileURLWithPath: path)) ---> breakpoint

Run Code Online (Sandbox Code Playgroud)

swift swift5 swift5.1

29
推荐指数
4
解决办法
3万
查看次数

如何解决“AddInstanceForFactory:没有为 id &lt;CFUUID 0x600001bef9c0&gt; 注册工厂”错误?

我正在学习https://github.com/LaiFengiOS/LFLiveKit/blob/master/samples/LFLiveKitSwiftDemo/LFLiveKitSwiftDemo/ViewController.swift的作用。

import UIKit
import LFLiveKit

class ViewController: UIViewController, LFLiveSessionDelegate {

  override func viewDidLoad() {
    super.viewDidLoad()

    session.delegate = self
    session.preView = self.view

    self.requestAccessForAudio()
    self.requestAccessForVideo()
    self.view.backgroundColor = UIColor.clear
    self.view.addSubview(containerView)
    containerView.addSubview(stateLabel)
    containerView.addSubview(closeButton)
    containerView.addSubview(beautyButton)
    containerView.addSubview(cameraButton)
    containerView.addSubview(startLiveButton)

    cameraButton.addTarget(self, action:  #selector(didTappedCameraButton(_:)), for: .touchUpInside)
    beautyButton.addTarget(self, action: #selector(didTappedBeautyButton(_:)), for: .touchUpInside)
    startLiveButton.addTarget(self, action: #selector(didTappedCloseButton(_:)), for: .touchUpInside)
  }

  override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
  }

  func requestAccessForAudio() -> Void {
    let status = AVCaptureDevice.authorizationStatus(for: AVMediaType.audio)
    switch status {
    case AVAuthorizationStatus.notDetermined:
      AVCaptureDevice.requestAccess(for: AVMediaType.audio, completionHandler: { ( granted ) in

      }) …
Run Code Online (Sandbox Code Playgroud)

ios swift

6
推荐指数
2
解决办法
1万
查看次数

标签 统计

swift ×2

ios ×1

swift5 ×1

swift5.1 ×1