flutter-form-builder-ecosystem / form_builder_phone_field

International phone number field for FlutterFormBuilder package
https://pub.dev/packages/form_builder_phone_field
BSD 3-Clause "New" or "Revised" License
11 stars 20 forks source link

Problem with cocoaPods #50

Open am77real opened 1 year ago

am77real commented 1 year ago

Is there an existing issue for this?

Package/Plugin version

2.0.1

Platforms

Flutter doctor

Flutter doctor ```bash armandom@Laptop-de-Armando flutter_application_1 % flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.16.0, on macOS 14.2 23C5047e darwin-arm64, locale es-MX) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.0.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] IntelliJ IDEA Community Edition (version 2023.2.5) [✓] VS Code (version 1.84.2) [✓] VS Code (version 1.85.0-insider) [✓] Connected device (3 available) [✓] Network resources • No issues found!

Minimal code example

Code sample pubspec.yaml dependencies: flutter: sdk: flutter flutter_form_builder: ^9.1.1 shared_preferences: ^2.2.2 form_builder_phone_field: ^2.0.1 ```dart import 'package:form_builder_phone_field/form_builder_phone_field.dart'; import 'package:form_builder_validators/form_builder_validators.dart'; Padding(padding: const EdgeInsets.only(left: 30, top: 2, right: 30, bottom: 4), child: FormBuilderPhoneField( name: 'phone_number', keyboardType: TextInputType.number, controller: ctrlPhone, defaultSelectedCountryIsoCode: 'MX', pickerItemHeight: 10, pickerSheetHeight: 10, decoration: const InputDecoration( hintText: 'Phone Number', suffixIcon: Icon(CupertinoIcons.phone), enabledBorder: OutlineInputBorder( borderSide: BorderSide(width: 2, color: Colors.blue), borderRadius: BorderRadius.all(Radius.circular(15)), ), ), priorityListByIsoCode: const ['MX'], validator: FormBuilderValidators.compose([ FormBuilderValidators.numeric(), FormBuilderValidators.required(), FormBuilderValidators.minLength(8), ]), ), ), ```

Current Behavior

I can't run the app on an iOS simulator

Expected Behavior

When form_builder_phone_field: ^2.0.1 is included in the pubspec.yaml file and the app is run in ios simulator (iphone 15 pro). sends the following error:

[!] CocoaPods could not find compatible versions for pod "PhoneNumberKit/PhoneNumberKitCore": In Podfile: phone_number (from .symlinks/plugins/phone_number/ios) was resolved to 2.0.1, which depends on PhoneNumberKit/PhoneNumberKitCore (= 3.5.10)

Steps To Reproduce

Error to run App

[!] CocoaPods could not find compatible versions for pod "PhoneNumberKit/PhoneNumberKitCore":
       In Podfile:
         phone_number (from `.symlinks/plugins/phone_number/ios`) was resolved to 2.0.1, which depends on
           PhoneNumberKit/PhoneNumberKitCore (= 3.5.10)

Aditional information

No response

itsmeabhi12 commented 12 months ago

@am77real

add this line in ios/PodFile

pod 'PhoneNumberKit/PhoneNumberKitCore', :git => 'https://github.com/marmelroy/PhoneNumberKit', :tag => '3.5.10'

so a final pod file looks like this

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  pod 'PhoneNumberKit/PhoneNumberKitCore', :git => 'https://github.com/marmelroy/PhoneNumberKit', :tag => '3.5.10'

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  target 'RunnerTests' do
    inherit! :search_paths
  end
end