DEV Community

Fré Dumazy
Fré Dumazy

Posted on

Accidentally removed Flutter binary on macOS

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 :)

Oldest comments (6)

Collapse
 
calebisstupid profile image
calebisstupid

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!

Collapse
 
agungsb profile image
Agung Surya Bangsa

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

Collapse
 
rubensdemelo profile image
rubensdemelo • Edited

Thank you !!

Collapse
 
ghenry profile image
Gavin Henry

Me too! Thanks!

Collapse
 
elsheikhmahmoud profile image
elsheikhmahmoud

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

Collapse
 
kotaro666dev profile image
Kotaro Kamashima

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! ;)