acoutts / flutter_libphonenumber

Leverages libphonenumber to allow for asynchronous and synchronous formatting of phone numbers in Flutter apps. Includes a TextInputFormatter to allow real-time AsYouType formatting.
MIT License
60 stars 73 forks source link

Update PhoneNumberKit/PhoneNumberKitCore version #51

Closed SPodjasek closed 1 year ago

SPodjasek commented 1 year ago

When running pod install --repo-update I get the following error:

[!] CocoaPods could not find compatible versions for pod "PhoneNumberKit/PhoneNumberKitCore":
  In snapshot (Podfile.lock):
    PhoneNumberKit/PhoneNumberKitCore (= 3.6.1)

  In Podfile:
    PhoneNumberKit (from `https://github.com/marmelroy/PhoneNumberKit`) was resolved to 3.6.1, which depends on
      PhoneNumberKit/PhoneNumberKitCore (= 3.6.1)

    flutter_libphonenumber_ios (from `.symlinks/plugins/flutter_libphonenumber_ios/ios`) was resolved to 1.1.0, which depends on
      PhoneNumberKit/PhoneNumberKitCore (= 3.6.0)

Specs satisfying the `PhoneNumberKit/PhoneNumberKitCore (= 3.6.1), PhoneNumberKit/PhoneNumberKitCore (= 3.6.0)` dependency were found, but they required a higher minimum deployment target.

And this PR fixes it...

acoutts commented 1 year ago

Thanks @SPodjasek Can you please bump the pubspec version and add a changelog entry?

jannisnikoy commented 1 year ago

@acoutts would love to see this PR merged!

Inventrohyder commented 1 year ago

Thanks @SPodjasek Can you please bump the pubspec version and add a changelog entry?

Updated it here: #54

SPodjasek commented 1 year ago

@acoutts done, sorry for the delay - I've missed notification somehow

SPodjasek commented 1 year ago

@jannisnikoy You can always use dependency override until it's merged:

dependency_overrides:
  flutter_libphonenumber_ios:
    git:
      url: git@github.com:inway/flutter_libphonenumber.git
      path: packages/flutter_libphonenumber_ios
      ref: fix-pnk-version
jannisnikoy commented 1 year ago

@jannisnikoy You can always use dependency override until it's merged:

@SPodjasek Do I need to do anything else other than override it? With this I still seem to get the original error, just with altered version numbers 🤪

 In Podfile:
    PhoneNumberKit (from `https://github.com/marmelroy/PhoneNumberKit`) was resolved to 3.6.3, which depends on
      PhoneNumberKit/PhoneNumberKitCore (= 3.6.3)

    flutter_libphonenumber_ios (from `.symlinks/plugins/flutter_libphonenumber_ios/ios`) was resolved to 1.1.0, which depends on
      PhoneNumberKit/PhoneNumberKitCore (= 3.6.1)
SPodjasek commented 1 year ago

@jannisnikoy Try now after my latest commit. It seems that in the meantime PhoneNumberKit has updated PhoneNumberKitCore to 3.6.3.

SPodjasek commented 1 year ago

It seems that 9b0baa4 just broke my CI/CD app build and I'm unable to diagnose it on some Mac device right now. But after changing version specification to more "loose" one in 19cbb3d - it was back to normal. Although it still resolves to 3.6.1 - probably due to some build cache as following line is visible in build logs:

`PhoneNumberKit` from `https://github.com/marmelroy/PhoneNumberKit`, 
   commit `025defce4bceab25c7ee4bfa9fd8179d5d48fcec`

which resolves to commit from Jun 15, 2023 - and 3.6.3 was committed today.

@acoutts Is such solution acceptable (19cbb3d), or you need specific versions as dependencies?

jannisnikoy commented 1 year ago

Thanks @SPodjasek! with your latest it works perfect

acoutts commented 1 year ago

Hm im not sure i understand - you mean the git tag reference isn't working? I'd rather keep it pointed to the git tag versions if we can, so it's easy to see what version we're pointed at. Could it just be a caching issue in your CI/CD environment?

acoutts commented 1 year ago

Ohh i see now, ok this is fine! I'll get it merged now unless there is more to fix. thank you!

acoutts commented 1 year ago

On second thought we need to keep it tied directly to a version to avoid sync issues where some new version of phonenumberkit gets pushed, and you get that new version after doing a pod update. That can cause unexpected behavior and cause the link between versions here and there to break.

acoutts commented 1 year ago

I'm finally understanding the issue here. We aren't using podspec/pods correctly here. It basically tries to resolve the latest version from git, and finds it doesn't match the one we requested in the podspec once a new version is pushed.

this is all because phonenumberkit stopped uploading to cocoapods and instead just use git now

what we need is a way to still use phonenumberkit but target a specific version/tag of it in the podspec.

Of course everyone can just do this in their podfile with the :git and :tag` fields but then we need everyone to specify the right version, not feasible. Digging into it more..

acoutts commented 1 year ago

It seems like the only option that can work is to fork the phonenumberkit repo, put it at a specific version, then we reference that fork in the project here.

when it's time to bump phonenumber kit, then we'd sync our fork to that new tag. essentially we have to rely on the fork doing the versioning for us.

acoutts commented 1 year ago

Frustrating, he's published it back on cocoapods with 3.6.3. I think we can go back to using it like before then, and any future updates we just need to make sure he pushes to cocoapods.

acoutts commented 1 year ago

Asked for his clarification here: https://github.com/marmelroy/PhoneNumberKit/issues/638

SPodjasek commented 1 year ago

I believe you should wait for clarification from PhoneNumberKit maintainer - hopefully he has managed to restore CacoaPods repo publication access, as this will make your/our life simpler 😉

acoutts commented 1 year ago

woot he replied! he has access now - great. so we can go back to just targeting the right version in cocoapods, and remove the readme section about adding it to the podfile. we should do a major version bump for this since it will require an update to everyone's podfile again.

SPodjasek commented 1 year ago

So I'll close this PR as no longer relevant

nicholasspencer commented 1 year ago

woot he replied! he has access now - great. so we can go back to just targeting the right version in cocoapods, and remove the readme section about adding it to the podfile. we should do a major version bump for this since it will require an update to everyone's podfile again.

Any timeline on when this major version is going to be release?

SPodjasek commented 1 year ago

@jannisnikoy FYI I've just dropped my branch, so if you're still using it switch back to regular package (remove dependency_overrides)...