natintosh / plugin_libphonenumber

MIT License
5 stars 40 forks source link

Cannot find type 'PhoneNumberKit' in scope #35

Open mashegoindustries opened 2 months ago

mashegoindustries commented 2 months ago

Xcode build done. 66.2s Failed to build iOS app Swift Compiler Error (Xcode): Cannot find type 'PhoneNumberKit' in scope /Users/xxxxx/.pub-cache/hosted/pub.dev/libphonenumber_plugin-0.3.3/ios/Classes/SwiftLibphonenumberPlugin.swift:6:24

Swift Compiler Error (Xcode): Extra argument 'phoneNumberKit' in call /Users/xxxxx/.pub-cache/hosted/pub.dev/libphonenumber_plugin-0.3.3/ios/Classes/SwiftLibphonenumberPlugin.swift:127:82

Encountered error while building for device.

apackin commented 2 months ago

I'm running into this too. Seems unusual since we've been using libphonenumber_plugin v0.3.3 for months. Any ideas for a work around?

Looks like it might be similar to https://github.com/natintosh/plugin_libphonenumber/issues/29

apackin commented 2 months ago

PhoneNumberKit package released version 4.0 earlier today, which introduced a breaking change renaming the API PhoneNumberKit to PhoneNumberUtility

apackin commented 2 months ago

Locking PhoneNumberKit to v3.8 works for now.

I added this in my target 'Runner' do block:

  # Revert breaking API change in 4.0
  pod 'PhoneNumberKit', :git => 'https://github.com/marmelroy/PhoneNumberKit.git', :commit => 'c107075aa8d394be7aced273a46e944afe8b321b'
wattanakorn495 commented 2 months ago

Here is my result after locking PhoneNumberKit to v3.8

Running pod install...                                            173.2s
Running Xcode build...                                          
Xcode archive done.                                         223.5s
Failed to build iOS app
Error (Xcode): Undefined symbols:

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

Encountered error while archiving for device.
Saifallak commented 2 months ago

https://stackoverflow.com/questions/78900034/cannot-find-type-phonenumberkit-and-extra-argument-phonenumberkit-in-call-er

user97116 commented 2 months ago

same issue

chauvansang1997 commented 1 month ago

You can edit libphonenumber_plugin.podspec: s.dependency 'PhoneNumberKit', '~> 3.6'