'Flutter: database is locked Possibly there are two concurrent builds running in the same filesystem location

Trying to run the app on my two iOS devices by doing flutter run -d all. However, I am getting database is locked Possibly there are two concurrent builds running in the same filesystem location. error.

What have I tried

  • flutter clean
  • flutter run separately
  • running the app on iPad on the terminal & on iPhone on xCode works

So, it looks like I am having a problem to run Flutter app on my two iOS devices at the same time.

Is there any solution for this?



Solution 1:[1]

This solution has worked for me, so try this:

  1. Remove the IOS folder in the project
  2. Run "flutter create --project-name={YOUR_PROJECT_NAME} ." command in the terminal on the root path of the project
  3. Run "flutter run" command or while main.dart selected start debugging

Solution 2:[2]

You can run the app in the release mod by using flutter run --release on multiple ios devices. Tested and worked inside the android studio.

Solution 3:[3]

I have MacBook Pro M1, and I solved this problem as follows:

I tried flutter create --projectname... etc and it did not work (you can see above this answer). I also glanced all of the topics, but they also did not work. So, you need to do these steps:

before doing these steps, in the terminal:

pod install

pod repo update

then:

1 - delete Podfile.lock file

2 - sudo arch -x86_64 gem install ffi in the root of the file

3 - cd ios

4 - arch -x86_64 pod install here, you must do this step in the ios folder

If it's works for your project as well, then you can give an upvote for people who are faced with a problem. Thanks

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Biclops
Solution 2 raj kavadia
Solution 3