You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
flutter run should fail if the initial cocoapods podspec repo hasn't been cloned instead of doing a 20 minute clone #9580
Right now if you don't have cocoapods installed we will (silently) set it up for you as part of the pod install run as part of flutter run. This first install can take 20 minutes. :/
It seems like it would be better to separate setup from running so we don't have a bad first-run experience.
%rm -rf ~/.cocoapods
%flutter run
Launching lib/main.dart on iPhone 6s in debug mode...
Running pod install...
CoreSimulatorBridge: Getting container class internal daemon!
It's just hanging checking out cocoapods:
32981 ttys000 0:00.02 /usr/local/git/current/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
I think a better experience would be to just fail instead of silently installing. @mit-mit
I think this is in part that #8983 doesn't appear solved. But I guess what I've learned is that I don't think we actually want that solved, but rather we probably want to fail-fast and force setup to be separate from running.
If you do this (would you like to install cocoapods now (Y/n)) please help the user understand how to make the decision. If I saw that on my first run, I wouldn't know how to answer. :/
Can we prompt to download cocoapods when the user needs it ?
If we detect the user needs cocoapods, and they don't have it, we error out, give them a nice message, and say "run flutter install cocoapods to get the hotness"
I don't think this is about installing CocoaPods, but about retrieving the
spec repo. If CocoaPods isn't installed, we just skip this step entirely.
I don't know if there's a reliable, stable way to check if the spec repo
has been downloaded, but that'd be what we'd have to check.
Initializing CocoaPods should be in our setup guide (run 'pod setup' to
download the specs), IIRC, so we could also add a doctor check for it.
tor. 27. apr. 2017 kl. 15.39 skrev Seth Ladd <[email protected]>:
How about this:
-
Can we prompt to download cocoapods *when the user needs it* ?
-
If we detect the user needs cocoapods, and they don't have it, we
error out, give them a nice message, and say "run flutter install cocoapods
to get the hotness"
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9580 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ATHjGZ8TcZCSj_RqzS_G008vmJRIQNjMks5r0RkZgaJpZM4NHt_L>
.
changed the title [-]`flutter run` should fail if cocoapods is missing instead of doing a 20 minute install[/-][+]`flutter run` should fail if the initial cocoapods podspec repo hasn't been cloned instead of doing a 20 minute clone[/+]on Apr 29, 2017
If the user has cocoapods installed but never cloned the specs, dump error and instructions and continue without resolving native dependencies to stay consistent with 3
Not sure I trust pod repo list's output's format. Probably safer to just check for ~/.cocoapods/repos/master's presence
In doctor
If the user doesn't have cocoapods, ask user to brew install and pod setup (i.e. clone) [✓]
If the user has cocoapods but doesn't have ~/.cocoapods/repos/master, ask the user to pod setup [✗]
In both cases 1 and 2, explain inline that it's not mandatory to build and run but without it, plugins won't work [✗]
If the project being built isn't iOS, nothing to do [✓]
If the project being built doesn't have a flutter: plugin: in their pubspec, nothing to do [✓]
If the user doesn't have cocoapods installed, dump error and instructions and continue without resolving native dependencies [✓]
If the user has cocoapods installed but never cloned the specs, dump error and instructions and continue without resolving native dependencies to stay consistent with 3 [✓]
In doctor
If the user doesn't have cocoapods, ask user to brew install and pod setup (i.e. clone) [✓]
If the user has cocoapods but doesn't have ~/.cocoapods/repos/master, ask the user to pod setup [✓]
In both cases 1 and 2, explain inline that it's not mandatory to build and run but without it, plugins won't work [✓]
One comment: I don't think that prompting is a good solution; we invoke Flutter tools also from IntelliJ, and while we do print the output to the console pane, that may be closed and thus the user won't see the prompt.
But also looks like we ended up not pursuing that approach?
@CharlesCleveJr, it's fixed in the sense that Flutter doesn't automatically and silently trigger a CocoaPods spec repo clone while building anymore.
Though we nevertheless still have a dependency on CocoaPods and the spec repo still needs to be cloned. We provide a message asking the user to perform that step (pod setup) manually now.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
eseidelGoogle commentedon Apr 25, 2017
I think this is in part that #8983 doesn't appear solved. But I guess what I've learned is that I don't think we actually want that solved, but rather we probably want to fail-fast and force setup to be separate from running.
eseidelGoogle commentedon Apr 27, 2017
I was bit by this again today. It's a really bad experience in intellij since it just prints
There is a window which shows up with background tasks "pod install", but the user won't know what that is. :(
FYI @devoncarew @mit-mit @jakobr-google
devoncarew commentedon Apr 27, 2017
Urk. I agree that we're better off failing the run (w/ good messaging), and having an explicit step to get cocoapods set up.
eseidelGoogle commentedon Apr 27, 2017
Actually intelliJ eventually gives up:
So this is worse than I thought. If you don't have cocaopods installed and flutter run, your runs will just eventually time out. :(
mit-mit commentedon Apr 27, 2017
Yes, we all agree. This has to be fixed. Just need to find someone who has cycles right now...
eseidelGoogle commentedon Apr 27, 2017
Just making it error out should be straightforward. Maybe @xster could help?
xster commentedon Apr 27, 2017
Maybe we should just show a prompt and let the user decide:
Showing prompts is probably a pattern we can expand more on with like #7863
sethladd commentedon Apr 27, 2017
If you do this (would you like to install cocoapods now (Y/n)) please help the user understand how to make the decision. If I saw that on my first run, I wouldn't know how to answer. :/
sethladd commentedon Apr 27, 2017
How about this:
Can we prompt to download cocoapods when the user needs it ?
If we detect the user needs cocoapods, and they don't have it, we error out, give them a nice message, and say "run flutter install cocoapods to get the hotness"
jakobr-google commentedon Apr 27, 2017
xster commentedon Apr 27, 2017
Let's defer the reasoning for the dependency to #9035. We should do it generally regardless of timing.
eseidelGoogle commentedon Apr 27, 2017
pod repo listappears to say if there are repos or not?[-]`flutter run` should fail if cocoapods is missing instead of doing a 20 minute install[/-][+]`flutter run` should fail if the initial cocoapods podspec repo hasn't been cloned instead of doing a 20 minute clone[/+]xster commentedon Apr 29, 2017
Step took 12 minutes on my monster mac pro too :(
Just to make sure I'm listing this correctly in sequence:
During build/run
flutter createmakes a Podfile. Wonder if we can scope down further the amount of users exposed to that file until they start using plugins (Defer CocoaPods dependency to as late as possible #9686)pod repo list's output's format. Probably safer to just check for~/.cocoapods/repos/master's presenceIn doctor
~/.cocoapods/repos/master, ask the user to pod setup [✗]xster commentedon May 1, 2017
With the 3 PRs above (#9687, #9741, #9703):
During build/run
In doctor
~/.cocoapods/repos/master, ask the user to pod setup [✓]mit-mit commentedon May 2, 2017
Thanks @xster, great improvements!
mit-mit commentedon May 2, 2017
One comment: I don't think that prompting is a good solution; we invoke Flutter tools also from IntelliJ, and while we do print the output to the console pane, that may be closed and thus the user won't see the prompt.
But also looks like we ended up not pursuing that approach?
xster commentedon May 2, 2017
ya, I didn't realize it took 10+ minutes on a beast machine. Let's skip the prompting for this scenario.
jakobr-google commentedon May 2, 2017
eseidelGoogle commentedon May 2, 2017
My impression is this is very close to resolved? Is there more work to do here for M2?
xster commentedon May 2, 2017
Still need to un-revert #9701 then merge #9703.
Should be good for Friday.
CharlesCleveJr commentedon Aug 9, 2017
Has there been a fix for this issue?
xster commentedon Aug 9, 2017
@CharlesCleveJr, it's fixed in the sense that Flutter doesn't automatically and silently trigger a CocoaPods spec repo clone while building anymore.
Though we nevertheless still have a dependency on CocoaPods and the spec repo still needs to be cloned. We provide a message asking the user to perform that step (
pod setup) manually now.github-actions commentedon Sep 4, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.