natintosh / plugin_libphonenumber

MIT License
5 stars 42 forks source link

Cannot find type 'PhoneNumberKit' in scope #35

Open mashegoindustries opened 3 months ago

mashegoindustries commented 3 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 3 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 3 months ago

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

apackin commented 3 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 3 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 3 months ago

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

user97116 commented 3 months ago

same issue

chauvansang1997 commented 2 months ago

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