loading...

Accidentally removed Flutter binary on macOS

dumazy profile image Frederik Dumazy ・1 min read

I've accidentally removed a binary file named Flutter on my Mac via Storage Management.

Afterwards I ran into this issue:
The 'Pods-Runner' target has transitive dependencies that include statically linked binaries: (/path/to/app/ios/Flutter/Flutter.framework)

How I've eventually fixed it:

  1. Fix Flutter SDK: Via a reinstall, but maybe changing channels and triggering a new build of the Flutter tool might work as well.
  2. Clean out the Cocoapods cache: pod cache clean --all
  3. Remove the Cocoapods cache directory: rm -rf "${HOME}/Library/Caches/CocoaPods"
  4. Repair the Pub cache: pub cache repair
  5. Start from a fresh checkout of the project. .packages should not be generated yet.
  6. flutter packages get
  7. Run (or build) the iOS app

Some of these steps probably aren't necessary or could be done in a better way, but this is what worked for me.
I just wanted to publish this in case it might help somebody in the future. That somebody might even be me.

If you've encountered the same issue before and was able to fix this, let me know how you did it :)

Posted on by:

dumazy profile

Frederik Dumazy

@dumazy

I'm an all-around developer focussing on mobile and web apps.

Discussion

pic
Editor guide
 

This literally just happened to me. Can confirm that for #1 a command line flutter upgrade on different channels or something does not work. Had to re-download and unpackage per installation instructions.

Also, I'm not sure 2,3,4 are needed either. I did those a few times but did not run them after the fresh install.

Either way, THANK YOU. Glad I'm not the only one!

 
 

You can add removing flutter.framework on from flutter folder on iOS and remove pubspec lock and podfile.lock.

 
 

This problem happened to me two days ago and again now!! Thanks for your tip. I finally understood what I did and made myself crystal clear what was happening! ;)

 

Thanks for saving my day! In my case, I needed all steps to make it working properly.