Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Don't rely on global pod installation, use bundled version #40135

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

Open
Tracked by #168015
tp opened this issue Sep 10, 2019 · 13 comments
Open
Tracked by #168015

Don't rely on global pod installation, use bundled version #40135

tp opened this issue Sep 10, 2019 · 13 comments
Labels
c: proposal A detailed proposal for a change to Flutter customer: crowd Affects or could affect many people, though not necessarily a specific customer. P3 Issues that are less important to the Flutter project platform-ios iOS applications specifically team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-ios Triaged by iOS platform team

Comments

@tp
Copy link

tp commented Sep 10, 2019

Use case

In addition to stock Cococapods we have some plugins required in our Podfile.

Cocoapods itself and the plugins are version controlled using bundler, and when running bundle exec pod install in the ios/ directory everything works fine.

But when executing flutter run it tried to use the global pod binary, which doesn't pick up the locally installed plugin we want to use.

Proposal

I am not super familiar with Cocoapods, so there might be a better solution to this.

What I would propose is to remove the hardcoded pod install in places like this:

<String>['pod', 'install', '--verbose'],

…and instead do some discovery to find out whether pod is locally available via bundle exec and in that case use that instead.

If there is any other workaround to make pod install aware of the local plugins that would also be fine.

I think in general it would be much better though not even to require the global pod installation, and do everything through bundled versions. (In our team we constantly have noise due to different people upgrading Cocoapods at different times and hence modifying the version string in the Podfile.lock file)

@BondarenkoStas BondarenkoStas added c: proposal A detailed proposal for a change to Flutter tool Affects the "flutter" command-line tool. See also t: labels. labels Sep 10, 2019
@jmagman jmagman added the platform-ios iOS applications specifically label Sep 10, 2019
@jmagman
Copy link
Member

jmagman commented Oct 5, 2019

Does #22998 cover your request?

@jmagman jmagman added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Oct 5, 2019
@HenriBeck
Copy link

Potentially yes, but I would see #22998 a potential follow up to this ticket.

This ticket would only allow you to switch to use the bundler, and I would see #22998 to use the bundler by default when creating new projects.

So yes, it would cover our request, but I wouldn't say it is the same. Whether or not to, by default, use the bundler for cocoa pods is something that could be discussed after this ticket has been implemented. Also, #22998 has a quite big architectural decision to be made.

@Antol
Copy link

Antol commented Oct 25, 2019

I also like to have all dependencies strictly set by a project environment (.ruby-version, Gemfile, Podfile - you know). And as I working with many projects at the same time, some of them are legacy, I can't rely on global versions of any tools. So I would love to have flutter build which respects Gemfile and Bundler as fastlane does

@no-response
Copy link

no-response bot commented Oct 26, 2019

Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
Thanks for your contribution.

@no-response no-response bot closed this as completed Oct 26, 2019
@tp
Copy link
Author

tp commented Oct 27, 2019

@jmagman As said, while #22998 would also cover this, we could fix this with much less changes, by just using the bundler-installed pod if available.

That would only be a first step though, as it would only be available to people "in the know" with their own Gemfile (A new Flutter project without pod globally installed doesn't add such a file yet).

But I think it would be worthwhile, because if this project ever decides to put a Gemfile in place by default, it would probably keep using the same code (bundle exec pod first, pod second) for backwards compatibility.

Just let me know if you agree with the above sentiment and would be willing to accept a PR that adds a check to first check whether there is a bundler-managed pod version and would opt to use that.

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Oct 27, 2019
@no-response no-response bot reopened this Oct 27, 2019
@iapicca iapicca added the customer: crowd Affects or could affect many people, though not necessarily a specific customer. label Mar 16, 2020
@jmagman jmagman added the P3 Issues that are less important to the Flutter project label Aug 18, 2020
@weichengwu
Copy link

I found rbenv global {{ruby_version}} can help

@federicopolesello
Copy link

federicopolesello commented Sep 2, 2022

@jmagman As said, while #22998 would also cover this, we could fix this with much less changes, by just using the bundler-installed pod if available.

That would only be a first step though, as it would only be available to people "in the know" with their own Gemfile (A new Flutter project without pod globally installed doesn't add such a file yet).

But I think it would be worthwhile, because if this project ever decides to put a Gemfile in place by default, it would probably keep using the same code (bundle exec pod first, pod second) for backwards compatibility.

Just let me know if you agree with the above sentiment and would be willing to accept a PR that adds a check to first check whether there is a bundler-managed pod version and would opt to use that.

Any news about this? I agree with this answer

@jmagman
Copy link
Member

jmagman commented Sep 2, 2022

If someone wants to send a PR, sgtm to try bundle exec pod if a user-created Gemfile is present in ios directory, and bundle exec pod actually runs, with a fallback to vanilla pod.

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team labels Jul 8, 2023
@wmadden
Copy link

wmadden commented Oct 8, 2023

<String>['pod', 'install', '--verbose'],

It would be enough to make the cocoapods command configurable, so the user could substitute bundle exec pod for pod. In that case it wouldn't be necessary to check for the presence of Gemfile, change the strategy of the runner, or add fallback behavior

@ciriousjoker
Copy link

This just became more important because of this issue:
CocoaPods/CocoaPods#12080

Essentially, the global pod installation suddenly became broken because of an XCode update.
One option is to mess with the global pods via sudo or to use a Gemfile with bundler.
The sudo option is obviously not preferred.

@KarimEbrahemAbdelaziz
Copy link

KarimEbrahemAbdelaziz commented May 14, 2024

Hello guys,
@ciriousjoker @wmadden @jmagman

I added the feature to support Bundler to manage Gem dependencies, please review the PR and test it out and share you suggestions if any to improve it.

Here is the Draft PR.

Meanwhile I'm working on the tests for my changes to be done this week.

Thank you.

@christopherfujino
Copy link
Contributor

@loic-sharma also here, should close these as wont-fix given our work on SPM?

@loic-sharma
Copy link
Member

Thanks for the ping! We can close this issue once we started deprecating CocoaPods. I added it to the Swift Package Manager umbrella issue: #126005

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: proposal A detailed proposal for a change to Flutter customer: crowd Affects or could affect many people, though not necessarily a specific customer. P3 Issues that are less important to the Flutter project platform-ios iOS applications specifically team-ios Owned by iOS platform team tool Affects the "flutter" command-line tool. See also t: labels. triaged-ios Triaged by iOS platform team
Projects
None yet
Development

No branches or pull requests