Skip to content

Instantly share code, notes, and snippets.

@dahabit
Last active February 26, 2022 23:03
Show Gist options
  • Save dahabit/0943b52e905735d4eef31fd2d3d2a3d1 to your computer and use it in GitHub Desktop.
Save dahabit/0943b52e905735d4eef31fd2d3d2a3d1 to your computer and use it in GitHub Desktop.
Shell file that clean any Pods or Flutter dependencies before build
#!/bin/sh
echo "========== Cleanup start =========="
rm -Rf ios/Pods
rm -Rf ios/.symlink
rm -Rf ios/Flutter/Flutter.framework
rm -Rf ios/Flutter/Flutter.podspec
rm -rf ios/Podfile.lock
rm -rf ~/Library/Developer/Xcode/DerivedData/* -y
rm -rf pubspec.lock
flutter clean
flutter packages get
cd ios
pod install
pod update
cd ..
echo "========== Cleanup end =========="
echo "Suggest you to restart your xcode"
echo "========== Have a nice day =========="
@NeatFastro
Copy link

An additional thing which might increase the the success chances is to add
rm pubspec.lock
Before the 'flutter clean'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment