Skip to content

Calling format() within an .xcframework results in Symbol not found: _$s14PhoneNumberKit0aB6FormatO4e164yA2CmFWC #836

@mungbeans2

Description

@mungbeans2

I've been using PhoneNumberKit in an iOS app successfully for several years.
Now I am packaging up the code from the app into an .xcframework for inclusion into another app.

While doing this I have discovered that calling format() works as expected when PhoneNumberKit is used directly, but it doesn't work when the CallNumberKit code is placed within a .xcframework and then called within there.

Only format() has an issue inside an .xcframework, every other function works as expected.

Steps to reproduce

  1. Create an Xcode framework project and add PhoneNumberKit to it (using pods)
  2. Add the following code

@objc class PhoneNumberUtils : NSObject {
class func causesError(mdn:String) {
do {
let phoneNumber = try PhoneNumberUtility().parse(mdn, withRegion: "us", ignoreType: true)
let _ = PhoneNumberUtility().format(phoneNumber, toType: PhoneNumberFormat.e164)
} catch {
NSLog("Threw")
}
}
}

  1. Build into an archive, turn the archive into a .xcframework
  2. Include the .xcframework into an iOS app, call PhoneNumberUtils.causesError().
Expected result

Phone number is formatted

Actual result

Xcode console displays:
dyld[728]: Symbol not found: _$s14PhoneNumberKit0aB6FormatO4e164yA2CmFWC

Environment

Xcode 16.2
Various iOS versions
Very latest version of PhoneNumberKit

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions