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
- Create an Xcode framework project and add PhoneNumberKit to it (using pods)
- 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")
}
}
}
- Build into an archive, turn the archive into a .xcframework
- 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