1

I think I have completed all the necessary steps for this, but it fails for some reason. This is the error I get:

Showing All Messages Undefined symbol: _OBJC_CLASS_$_HCKBeaconCentralManager

enter image description here

I have set the file in Build Settings:

enter image description here

This is the content of bridge file:

#import "HCKBeaconCentralManager.h"
#import "HCKBeaconInterface.h"
#import "HCKBeaconBaseModel.h"
#import "HCKBeaconProtocol.h"

Just in case this is code I use to try to call the SDK classes:

import UIKit
import SwiftUI
import CoreLocation
import CoreBluetooth

@available(iOS 13.0, *)
class SceneDelegate: UIResponder, UIWindowSceneDelegate,HCKCentralScanDelegate {

    func centralManagerScanNewDeviceModel(_ beaconModel: HCKBeaconBaseModel!, manager: HCKBeaconCentralManager!) {
        print("centralManagerScanNewDeviceModel")
    }

    var window: UIWindow?

    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        print("scene init")
        HCKBeaconCentralManager.sharedInstance()?.scanDelegate = self
    }

    func sceneDidDisconnect(_ scene: UIScene) {
    }

    func sceneDidBecomeActive(_ scene: UIScene) {
    }

    func sceneWillResignActive(_ scene: UIScene) {
    }

    func sceneWillEnterForeground(_ scene: UIScene) {
    }

    func sceneDidEnterBackground(_ scene: UIScene) {
    }
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
somerandomusername
  • 1,993
  • 4
  • 23
  • 55

1 Answers1

4

Add your Objective-C files into Xcode->Targets->Build Phases->Compile Sources.

Aleksey Potapov
  • 3,683
  • 5
  • 42
  • 65
  • Your answer save my live Thanks man I don't know why apple didn't mention this – Bosoud Dec 21 '20 at 07:32
  • If you are building Swift in XCode, and you dragged and dropped a folder of objective C modules into your project, XCode may not add those objective C .m files onto the project's target build list. You can manually add a group (folder) to the project and add those objective C files into the group. Then XCode will add them to the target build list. – Lexo May 19 '23 at 17:26