malayze
malayze

Reputation: 63

How do I fix this flutter iOS error in Xcode?

When I run the command "flutter build ios" - my app is built just fine. I can also run the app in the simulator. However, in Xcode, when I try to open the project, I get the error "unable to attach to DB: error: accessing build database"

This is the first time I've come across this problem on this app. Flutter doctor comes out clean, and nothing changes if I run "flutter clean" and build it again. I can't distribute my app until this is fixed.

Upvotes: 4

Views: 5590

Answers (2)

Arinzehills
Arinzehills

Reputation: 2329

This worked for me, after i run this command

rm -rf ~/Library/Developer/Xcode/DerivedData/

Then i rerun the app and it came to life.

Upvotes: 0

Stefano Alvares
Stefano Alvares

Reputation: 146

That happens at times when the iOS build gets corrupted for some reason.
Close Xcode.
Run flutter clean
After that flutter build ios
Open Xcode again and run your app.
This should generally solve your issue.

If that does not work, you can try this:

  1. flutter clean
  2. cd ios
  3. rm Podfile.lock
  4. rm -rf Pods
  5. pod deintegrate
  6. pod cache clean
  7. pod setup
  8. pod install

After that run flutter build ios

Upvotes: 9

Related Questions