Linker error for Swift iOS app with in-app review and logging

As a Swift noob, I am getting the following linker error on xCode when running my app:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>ld: Undefined symbols:
os.Logger.logObject.getter : __C.OS_os_log, referenced from:
(1) suspend resume partial function for closure #1 @Sendable () async -> () in static godot_plugin.SwiftClass.launch_review_flow() -> () in InappReviewPlugin.a[4](SwiftClass.o)
(3) suspend resume partial function for closure #1 @Sendable () async -> () in static godot_plugin.SwiftClass.launch_review_flow() -> () in InappReviewPlugin.a[4](SwiftClass.o)
os.Logger.init() -> os.Logger, referenced from:
one-time initialization function for logger in InappReviewPlugin.a[4](SwiftClass.o)
type metadata accessor for os.Logger, referenced from:
one-time initialization function for logger in InappReviewPlugin.a[4](SwiftClass.o)
(1) suspend resume partial function for closure #1 @Sendable () async -> () in static godot_plugin.SwiftClass.launch_review_flow() -> () in InappReviewPlugin.a[4](SwiftClass.o)
</code>
<code>ld: Undefined symbols: os.Logger.logObject.getter : __C.OS_os_log, referenced from: (1) suspend resume partial function for closure #1 @Sendable () async -> () in static godot_plugin.SwiftClass.launch_review_flow() -> () in InappReviewPlugin.a[4](SwiftClass.o) (3) suspend resume partial function for closure #1 @Sendable () async -> () in static godot_plugin.SwiftClass.launch_review_flow() -> () in InappReviewPlugin.a[4](SwiftClass.o) os.Logger.init() -> os.Logger, referenced from: one-time initialization function for logger in InappReviewPlugin.a[4](SwiftClass.o) type metadata accessor for os.Logger, referenced from: one-time initialization function for logger in InappReviewPlugin.a[4](SwiftClass.o) (1) suspend resume partial function for closure #1 @Sendable () async -> () in static godot_plugin.SwiftClass.launch_review_flow() -> () in InappReviewPlugin.a[4](SwiftClass.o) </code>
ld: Undefined symbols:
  os.Logger.logObject.getter : __C.OS_os_log, referenced from:
      (1) suspend resume partial function for closure #1 @Sendable () async -> () in static godot_plugin.SwiftClass.launch_review_flow() -> () in InappReviewPlugin.a[4](SwiftClass.o)
      (3) suspend resume partial function for closure #1 @Sendable () async -> () in static godot_plugin.SwiftClass.launch_review_flow() -> () in InappReviewPlugin.a[4](SwiftClass.o)
  os.Logger.init() -> os.Logger, referenced from:
      one-time initialization function for logger in InappReviewPlugin.a[4](SwiftClass.o)
  type metadata accessor for os.Logger, referenced from:
      one-time initialization function for logger in InappReviewPlugin.a[4](SwiftClass.o)
      (1) suspend resume partial function for closure #1 @Sendable () async -> () in static godot_plugin.SwiftClass.launch_review_flow() -> () in InappReviewPlugin.a[4](SwiftClass.o)

The swift code is trying to launch an in-app review form using StoreKit framework: [It is a part of an iOS in-app review plugin for Godot engine]

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>import Foundation
import SwiftUI
import OSLog
import StoreKit
@available(iOS 16.0, *)
extension UIApplication {
class func getTopViewController(base: UIViewController? = UIApplication.shared.windows.first { $0.isKeyWindow }?.rootViewController) -> UIViewController? {
if let nav = base as? UINavigationController {
return getTopViewController(base: nav.visibleViewController)
} else if let tab = base as? UITabBarController, let selected = tab.selectedViewController {
return getTopViewController(base: selected)
} else if let presented = base?.presentedViewController {
return getTopViewController(base: presented)
}
return base
}
}
@available(iOS 16.0, *)
extension UIViewController {
/// Request a App Store review from the user
///
/// - Parameters:
/// - delay: The number of seconds this function will wait before showing the modal.
func requestReview(delay: Double) {
Task {
// Use the equation n * 10^9 to convert seconds to nanoseconds.
try? await Task.sleep(nanoseconds: UInt64(delay * pow(10.0, 9.0)))
if let windowScene = self.view.window?.windowScene,
self.navigationController?.topViewController == self {
SKStoreReviewController.requestReview(in: windowScene)
}
}
}
}
@available(iOS 16.0, *)
@objcMembers public class SwiftClass : NSObject
{
static let logger = Logger()
static func launch_review_flow() {
Task {
logger.info("SwiftClass: launch_review_flow(): Task")
if let topVC = await UIApplication.getTopViewController() {
logger.info("SwiftClass: launch_review_flow(): Task: topVC")
await topVC.requestReview(delay: 1.5)
}
}
}
}
</code>
<code>import Foundation import SwiftUI import OSLog import StoreKit @available(iOS 16.0, *) extension UIApplication { class func getTopViewController(base: UIViewController? = UIApplication.shared.windows.first { $0.isKeyWindow }?.rootViewController) -> UIViewController? { if let nav = base as? UINavigationController { return getTopViewController(base: nav.visibleViewController) } else if let tab = base as? UITabBarController, let selected = tab.selectedViewController { return getTopViewController(base: selected) } else if let presented = base?.presentedViewController { return getTopViewController(base: presented) } return base } } @available(iOS 16.0, *) extension UIViewController { /// Request a App Store review from the user /// /// - Parameters: /// - delay: The number of seconds this function will wait before showing the modal. func requestReview(delay: Double) { Task { // Use the equation n * 10^9 to convert seconds to nanoseconds. try? await Task.sleep(nanoseconds: UInt64(delay * pow(10.0, 9.0))) if let windowScene = self.view.window?.windowScene, self.navigationController?.topViewController == self { SKStoreReviewController.requestReview(in: windowScene) } } } } @available(iOS 16.0, *) @objcMembers public class SwiftClass : NSObject { static let logger = Logger() static func launch_review_flow() { Task { logger.info("SwiftClass: launch_review_flow(): Task") if let topVC = await UIApplication.getTopViewController() { logger.info("SwiftClass: launch_review_flow(): Task: topVC") await topVC.requestReview(delay: 1.5) } } } } </code>
import Foundation
import SwiftUI
import OSLog
import StoreKit

@available(iOS 16.0, *)
extension UIApplication {
    class func getTopViewController(base: UIViewController? = UIApplication.shared.windows.first { $0.isKeyWindow }?.rootViewController) -> UIViewController? {
        if let nav = base as? UINavigationController {
            return getTopViewController(base: nav.visibleViewController)

        } else if let tab = base as? UITabBarController, let selected = tab.selectedViewController {
            return getTopViewController(base: selected)

        } else if let presented = base?.presentedViewController {
            return getTopViewController(base: presented)
        }
        return base
    }
}

@available(iOS 16.0, *)
extension UIViewController {
    /// Request a App Store review from the user
    /// 
    /// - Parameters:
    ///     - delay: The number of seconds this function will wait before showing the modal.
    func requestReview(delay: Double) {
        Task {
            // Use the equation n * 10^9 to convert seconds to nanoseconds.
            try? await Task.sleep(nanoseconds: UInt64(delay * pow(10.0, 9.0)))
            if let windowScene = self.view.window?.windowScene,
                self.navigationController?.topViewController == self {
                SKStoreReviewController.requestReview(in: windowScene)
            }
        }
    }
}

@available(iOS 16.0, *)
@objcMembers public class SwiftClass : NSObject
{
    static let logger = Logger()

    static func launch_review_flow() {
        Task {
            logger.info("SwiftClass: launch_review_flow(): Task")
            if let topVC = await UIApplication.getTopViewController() {
                logger.info("SwiftClass: launch_review_flow(): Task: topVC")
                await topVC.requestReview(delay: 1.5)
            }
        }
    }
}

I know it is related to the loggers and the partial functions around the await statements, but my attempts to fix this have failed.

Any help in fixing this problem would be appreciated.

Additionally, any suggestions on optimizing or correcting related or unrelated parts of the code would also be greatly appreciated.

????

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật