Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift Compiler Error (Xcode): Cannot find type 'PhoneNumberKit' in scope #441

Open
mashegoindustries opened this issue Aug 20, 2024 · 17 comments

Comments

@mashegoindustries
Copy link

Cannot compile

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

Uncategorized (Xcode): Command SwiftCompile failed with a nonzero exit code

Encountered error while building for device.

@emanuel-braz
Copy link

Same here, any updates?

@chungxon
Copy link

chungxon commented Aug 21, 2024

You can lock the PhoneNumberKit version to 3.8.0 in your Podfile because the PhoneNumberKit package just released new version 4.0. It has a breaking change by renaming PhoneNumberKit to PhoneNumberUtility marmelroy/PhoneNumberKit#798

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  # This is just a temporary solution to fix the iOS build issue. We need to remove this line after the author fixes this [issue](https://github.com/natintosh/plugin_libphonenumber/issues/35)
  pod 'PhoneNumberKit', '3.8.0'

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

@juandps
Copy link

juandps commented Aug 23, 2024

Same issue here. I'm using flutterflow to develop my app. I cant fix the issue locally and deploy from an specific branch but this must be resolved else I should consider using another lib.

How can we help?

@juandps
Copy link

juandps commented Aug 26, 2024

@natintosh Can you update PhoneNumberKit version please?

@ravid007
Copy link

ravid007 commented Sep 2, 2024

Same issue here, Cannot find type 'PhoneNumberKit' in scope
@natintosh I would really appreciate it if you could fix and update the package.

@Shahidbangash
Copy link

i am applying fix and will create Pull request

@zivrozz
Copy link

zivrozz commented Sep 2, 2024

Following...

@Shahidbangash
Copy link

Shahidbangash commented Sep 3, 2024

Hey , After debugging Package , i realised this error is coming from Another package plugin_libphonenumber and this package then uses another package called PhoneNumberKit.

During debugging of plugin_libphonenumber , i found that version 3.8.0 and 4.0.0 is causing this Cannot find type 'PhoneNumberKit' in scope. Although i could not find the exact reason of this but i was able to make a build on version 3.7.8

This was the context and i hope this will be helpful for author or people working on this plugin .

--- Now to solve this problem for your flutter app replace code in pubspec.yaml to this
Replace this

intl_phone_number_input: your pub version of package

with

  intl_phone_number_input:
    git:
      url: https://github.com/Shahidbangash/intl_phone_number_input.git
      ref: develop 
then you need to do flutter clean
also delete pubspec.lock file and pod.lock to get rid of old version.

do flutter pub get 
and then cd ios 
pod install 

Now this should work

@juandps
Copy link

juandps commented Sep 4, 2024

@natintosh Could you please help? I can buy you a coffee :)

@simply-alliv
Copy link

Subscribing to this thread as we are also experiencing the exact same issue.

@arsarsars1
Copy link

You can lock the PhoneNumberKit version to 3.8.0 in your Podfile because the PhoneNumberKit package just released new version 4.0. It has a breaking change by renaming PhoneNumberKit to PhoneNumberUtility marmelroy/PhoneNumberKit#798

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  # This is just a temporary solution to fix the iOS build issue. We need to remove this line after the author fixes this [issue](https://github.com/natintosh/plugin_libphonenumber/issues/35)
  pod 'PhoneNumberKit', '3.8.0'

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

Perfect solutions. It worked for me. If anyone needs help you can mail me I will fix the issue for you. Thank you
[email protected]

@juandps
Copy link

juandps commented Sep 5, 2024

The tactical solution is fine but we might need a permanent solution, I am not familiar with the lib whatsoever else I would do it myself.

@juandps
Copy link

juandps commented Sep 5, 2024

But if someone can guide me on how to do it I will do it

@Gurvan2
Copy link

Gurvan2 commented Sep 23, 2024

I hadn't seen this issue, so the solution I used to get round this error was to add the package flutter_libphonenumber. It works, but it's not a clean, definitive solution

@paddyrehill
Copy link

Hi,
The issue is actually fixed at the current develop branch targeting v0.7.5 but it is not yet deployed.

At Perci Health we simply forked the repo and published to intl_phone_number_input_perci under the MIT license.

It is possible to use as a temporary workaround.

  1. Install intl_phone_number_input_perci: ^0.7.5.
  2. Import packages
    import 'package:flutter/material.dart';
    import 'package:intl_phone_number_input_perci/intl_phone_number_input_perci.dart';
    

The rest of the code should be compatible with intl_phone_number_input.

In Flutterflow add intl_phone_number_input_perci: ^0.7.5 to the pubspec dependancies in any custom function.

@gorkemhacioglu
Copy link

Hi, The issue is actually fixed at the current develop branch targeting v0.7.5 but it is not yet deployed.

At Perci Health we simply forked the repo and published to intl_phone_number_input_perci under the MIT license.

It is possible to use as a temporary workaround.

  1. Install intl_phone_number_input_perci: ^0.7.5.
  2. Import packages
    import 'package:flutter/material.dart';
    import 'package:intl_phone_number_input_perci/intl_phone_number_input_perci.dart';
    

The rest of the code should be compatible with intl_phone_number_input.

In Flutterflow add intl_phone_number_input_perci: ^0.7.5 to the pubspec dependancies in any custom function.

worked for me, thanks a lot.

@naderhezzy
Copy link

@natintosh Waiting for your updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests