How to resolve an error: The sandbox is not in sync with the Podfile.lock
Asked Answered
F

7

35

When I add new plugin in Flutter, I get this error in my runner xcode:

The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation

and I have already install CocoaPods and updated. I tried to run pod install and not fixed it help please

Findley answered 3/8, 2020 at 9:29 Comment(0)
F
45

In my case the issue was caused by a local android only plugin. I created a dummy podsec file for the plugin, then ran:

cd ios
flutter pub get
pod install
pod update

It seems like I need to do these steps after every xcode project clean now.

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.17.4, on Mac OS X 10.15.6 19G73, locale en-AU)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Android Studio (version 4.0)
Finality answered 10/8, 2020 at 0:49 Comment(2)
@MebroukiAmine Do you get any errors from pod install? Try removing pods folder first.Finality
just running cd ios flutter pub get pod install pod update fixed it for meShelashelagh
J
30

In my case, i have cleaned the build and then updated the pod files , yet there were some warnings but those can be neglected:

> flutter clean
> flutter pub get
> cd ios
> pod update
Jockey answered 17/6, 2021 at 12:11 Comment(1)
This worked for me but with a slight change > flutter clean > flutter pub get > cd ios > rm Podfile.lock > pod install **Note : On mac this did not work from terminal in android studio but worked in the Terminal app **Semiliterate
A
8

If anyone on an M1 Mac runs into this and gets an error running pod update, for me the fix was not running that command from VS Code but in the default terminal after setting it to Open using Rosetta.

enter image description here

After that it updated properly and I could build my app.

Actinomorphic answered 11/11, 2021 at 11:8 Comment(0)
N
0

In my case the message appeared because I did not have the Podfile nor the Podfile.lock. Strangely by running flutter pub get it did not generated them either. Then I decided to add a random package to my pubspec.yaml (I still hadn't added any), say shared preferences, ran again flutter pub get and this time both Podfile and Podfile.lock were created. Weird behavior, but that's the way I worked it out.

Nutbrown answered 4/3, 2022 at 3:35 Comment(0)
G
0

if you are facing this issue in 2022

then simply first of all backup the entire runner folder from your iOS directory and then delete your entire iOS directory and then run ' flutter create . ' this command will recreate your project for all the platform after running this project go to the newly created iOS folder and then delete the runner folder and paste the runner folder you backed up before enjoy your issue will be. solved now

Gretna answered 12/10, 2022 at 4:39 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Doggerel
F
0

Open the iOS folder in finder

  • Delete Podlock file
  • Delete pods folder

Then open terminal in iOS folder

  • run pod install

then open Runner.xcworkspace and run the app it will work

Fabi answered 13/11, 2023 at 11:31 Comment(0)
A
-1

Had the same error and solved it with these two simple steps:

  1. Delete only the Podfile.lock file
  2. Run flutter clean && flutter run
Augustaugusta answered 10/8, 2022 at 23:4 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.