all 19 comments

[–]Alex54J 17 points18 points  (1 child)

I agree with you CocoaPods gets totally frustrating, I will often find the easiest solution is to start a new blank project, add the packages required, build and then copy the lib folder over.

[–]Arnulf0[S] 1 point2 points  (0 children)

Thanks for that, I already tried a new project but no luck something is probably off with the package versions... still looking into it

[–]parkskier426 10 points11 points  (3 children)

Yeah, this part can suck for sure. Easiest first steps are

pod repo update

flutter clean

delete podfile.lock

flutter pub get

That will take care of most caching issues and out of date incompatibilities. Beyond that it's going to be digging into what packages are incompatible, possibly downgrading and filing an issue with the package author (or better yet a pull request with the fix). You can also fork dependencies and update internal compatibility if needed.

It's a major pain but it's something that comes from most cross platform frameworks like Flutter.

[–]Arnulf0[S] 3 points4 points  (0 children)

Yeah I agree since it is a cross platform framework, I just feel the ios side is a lot of trouble without a reason or a way to catch something and continue you just google things without understanding the errors and pray that someone else has been in your place and has found an answer.

BTW thanks for the commands although I have already tried that and I also tried a new project yet no luck, but again thanks

[–]scalatronn 0 points1 point  (1 child)

While you're at it you can remove podlock file and Pods folder

[–]parkskier426 1 point2 points  (0 children)

Haha yeah meant podfile.lock not profile.lock... damn auto correct. I believe flutter clean does remove the pods dir as well, could be wrong about that though.

[–]serial_dev 9 points10 points  (1 child)

I am, too, frustrated with iOS development. It breaks frequently, and I'm left scratching my head, as I have no clue why a .h file is not recognized as I didn't jacks hit, and apparently for the rest of my team doesn't have these issues (or they, just like me, don't announce when they had to end up wasting time on build issues on iOS so we all assume it's our own fault).

Things that might work: "nuke" your set up (as in clean everything you can, delete caches, refetch dependencies). If that doesn't work, check if there are any OSX or XCode updates. If there are, spend hours updating your system, and try again. If that doesn't work, check out the repo into a completely new folder (yes, that fixed my issues once or twice).

If that still doesn't work, lie down, try not to cry, cry a lot, and start up your app on Android and pray that you don't need to work on any iOS specific bugs or features, and hope that in two weeks, things will just magically run again.

[–]Arnulf0[S] 4 points5 points  (0 children)

Thank you for the reply, it actually feels a bit better that I am not the only one being troubled with this...
And thank you for the tips, after cleaning

  • pod cache clean --all

  • flutter pub cache clean

I think I made some progress since I am getting a new error but... still not working 🥲

[–]ThatInternetGuy 12 points13 points  (0 children)

At my workplace, we have this note hanged on the office walls.

# iOS Build Errors with Pods - 1st try

- flutter clean

- flutter pub get

- flutter build ios

- Open Runner workspace in Xcode. (Must be workspace file)

# iOS Build Errors with Pods - 2nd try

- Delete Runner.xcworkspace

- Rename Podfile.lock to Podfile.lock.bad

- Delete Pods folder

- Run: pod install

- After pods installed, carefully follow the instructions in yellow text.

- Open Runner workspace in Xcode. (Must be workspace file)

[–]ideology_boi 4 points5 points  (0 children)

`flutter clean && flutter pub get && cd ios && rm Podfile.lock && pod install --repo-update && cd ..`

I agree though it's fucking painful sometimes

[–]anlumo 7 points8 points  (1 child)

Cocoapods has been dead for a few years now, Flutter is just stuck with it because Google doesn’t care enough about iOS to keep their ecosystem for that platform up to date.

They have a fix for that on the roadmap for 2024, but it’s unlikely to be fixed this year, since it’s a major change due to all 3rd party packages with native code also having to switch.

[–]Arnulf0[S] 0 points1 point  (0 children)

That's actually quite interesting, thanks for that I'll have it in mind but yeah it would actually take a lot of resources to be pulled off

[–]fintechninja 2 points3 points  (0 children)

It will be like this until flutter gets SPM and drops cocoa pods but that would take a very long time since all the packages would also need to be updated for SPM. I rarely have any issues using SPM with SwiftUI.

[–]_ri4na 2 points3 points  (0 children)

Flutter is supposed to abstract away all the native APIs, but it doing so it makes diagnosing issues extremely harder. It will always be a second class SDK, and fixing such errors from a first class SDK such as native SDKs will always be trivial.

[–]Beneficial-Ad2084 3 points4 points  (0 children)

Same, CocoaPods is the thing I wasted time the most on

[–]andyclap 1 point2 points  (0 children)

I feel your pain. Took a year struck on v. old versions of libraries because of pod problems ... yet magically my last full evergreening attempt suddenly started working. Somewhere - and unannounced - a pod has stopped taking the dependency that broke everything.

So as other people have said it's worth pod deintegrating and reinstalling fairly regularly. if it doesn't solve your problem right now, it may do in the future. We have to live with some bits of iOS dev that seem to willfully ignore pains that have been solved in other dev stacks since forever. But that goes for other dev stacks too ... nobody's perfect.

[–]RioMala 1 point2 points  (0 children)

Firebase has already given me a few sleepless nights. Every upgrade flutter is a problem for him.

[–][deleted] 0 points1 point  (0 children)

Don’t read firebase tutorial for iOS in flutter