0

I accidentally deleted the DerivedData folder, not only its files.

Applying this command "rm -rf ~/Library/Developer/Xcode/DerivedData"

Instead of this command "rm -rf ~/Library/Developer/Xcode/DerivedData/"

After that Xcode started to return following errors.

Error # 1 : Sandbox: rsync.samba(12046) deny(1) file-write-create /Users/mycompany/Library/Developer/Xcode/DerivedData/Runner-bfdtmaowyaodbagkvttzeqjhiwjl/Build/Products/Debug-iphonesimulator/Flutter.framework

Error # 2 : Sandbox: dart(12019) deny(1) file-write-create /Users/mycompany/Library/Developer/Xcode/DerivedData/Runner-bfdtmaowyaodbagkvttzeqjhiwjl/Build/Products/Debug-iphonesimulator/.last_build_id

Error # 3 : Flutter failed to write to a file at "/Users/mycompany/Library/Developer/Xcode/DerivedData/Runner-bfdtmaowyaodbagkvttzeqjhiwjl/Build/Products/Debug-iphonesimulator/.last_build_id".

I also run following commands (not in order, while trying to solve it by myself)

  • pod cache clean --all
  • pod install --repo-update
  • pod install

Because of those errors Xcode can't build the app.

Here is the version information of my development environment.

  • Flutter - Stable channel - 3.16.7 on Macos 14.2.1 darwin-arm64

  • Dart - 3.2.4

  • Devtools 2.28.5

  • Platform Android 33, build tools 34.0.0

  • OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

  • Android Studio 2023.1

  • Xcode 15.2

  • CocoaPods 1.12.0

Any help will be appreciated. Thank you very much in advance.

4
  • 1
    Never any issue with deleting the DerivedData folder. If it's not there Xcode will recreate it. Did you try a Product > Clean Build Folder in Xcode and/or simply restarting Xcode? Commented Jan 16, 2024 at 21:52
  • Yes I did for many times. (Clean Build Folder, restarting xCode, flutter clean etc.) As I understand DerivedData is not an app specific folder, brand new applications don't return this error. The only reason I suspect is because error messages addressing this folder. Commented Jan 17, 2024 at 6:57
  • Actually I may have a clue about this. I changed Runner > Build Settings > Quoted Include in Framework Header value to NO (I did it to solve some issues comes from revenuecat plug-in) Now I change it to YES and two of errors has gone. Only Error #3 remained in the list. Commented Jan 17, 2024 at 7:05
  • 1
    I will close this question. Because I made some changes to solve RevenueCat problems (Changing the value of "Runner > Build Settings > Quoted Include in Framework Header" from YES to NO), when I revert this change, 3 of the problems are gone. The problem was solved after commenting that deleting DerivedData would not cause such a problem. Thank you very much. Commented Jan 17, 2024 at 9:53

1 Answer 1

0

this looks like an issue with Xcode in the local environment. Let's try changing to another location to see if it helps.

Xcode -> Settings -> Locations

ref: https://github.com/flutter/flutter/issues/157461#issuecomment-2436805260

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.